Summary

3 minutes
Share the link to this page
Copied
  Completed
  • In Python, multiple assignments can be used to initialize several variables in a single statement.
  • A Python list is a variable that can store multiple items of data in sequentially-numbered elements that start at zero.
  • Data stored in a list element can be referenced using the list name followed by an index number in [ ] square brackets.
  • The len() function returns the length of a specified list.
  • A Python tuple is an immutable list whose values can be assigned to individual variables by “sequence unpacking”.
  • Data stored in a tuple element can be referenced using the tuple name followed by an index number in [ ] square brackets.
  • A Python set is an unordered collection of unique elements whose values can be compared and manipulated by its methods.
  • Data stored in a set cannot be referenced by index number.
  • A Python dictionary is a list of key: value pairs of data in which each key must be unique.
  • Data stored in a dictionary element can be referenced using the dictionary name followed by its key in [ ] square brackets.
  • The Python if keyword performs a conditional test on expression for a Boolean value of True or False.
  • Conditional branching provides alternatives to an if test with the else and elif keywords.
  • A while loop repeats until a test expression returns False.
  • A for in loop iterates over each item in a specified list or string.
  • The range() function generates a numerical sequence that can be used to specify the length of a for-in loop.
  • The break and continue keywords interrupt loop iterations.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.