Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Unit 6 Review

All
All
All
All

quotes, it is a string, not an integer.


Strings are immutable (cannot be changed). Therefore, if we

strings and strings only are in quotes .


dictionaries and dictionaries only are in squiggly brackets { }.
lists and lists only are in square brackets [ ].
integers and floats (decimals) are numbers. If an integer is in

wants to add two strings together, we will have to create a new


variable and use + sign.
Ex) new_variable = variable1 + variable2

Lists are mutable (can be changed). Therefore, we do not have to


create a new variable. We use the append() function to add new
element or del list_name[index number] to remove an element.
Note that we can only add one element at a time or else, we will
get an error!
Ex) aList.append(5) #adds 5 to end of the list

Ex) Del aList[0] #removes the element located at index 0 in the list

Dictionaries are useful for storing data pairs such as name &
phone number or item & price. Lists are useful for looping and
manipulating.

***If theres something you dont understand (modules, rules,


functions etc), always look it up on Google! Searching for
resources is basics of programming***

You might also like