Great job!. It’s time to wrap things up! Here are some things we learned:
print() prints whatever is put inside its parentheses
- Variables are declared and assigned values using the equality (
- Some basic variable types are: integers, floats, and strings. Strings are put inside single (
' ') or double (
" ") quotes.
- You can convert between variable types to string using
- Comments start with
- List definitions require comma-separated elements to be listed inside square brackets:
invited_guests = ['Mark', 'Hannah', 'Walter']
- List elements are accessed with square brackets. Indexing starts at 0.
invited_guests #first element
invited_guests[0:2] #first and second element
invited_guests[1:] #all elements except for the first one
- To get the number of elements in a list, use the
Alright, it’s time for a short quiz!