Manar Naboulsi • Integers: o whole numbers positive, negative, and

Manar Naboulsi






Integers:
o whole numbers
 positive, negative, and zero
 ex. 360
Floating Point Numbers:
o a.k.a. float
o decimals
 ex. 2.667
 ex. 360.0
Strings:
o words in quotations
 ex. “hey”
 ex. ‘hey’
o using a backslash (\) followed by a “ or ‘ indicates that it is not a function but rather part
of a text
Booleon:
o true/false
Lists:
 ex. [1,2,3,4]
 ex. [“hey”, “hi”, “hello”)
Operators:
o addition:
 type “print 3+2” in python
 answer will come up in error display
 the sum of two integers is always an integer
 the sum of two floats is always a float
 the sum of one float and one integer is always a float
o subtraction:
 type “print 3-2” in python
 answer will come up in error display
 same rules as addition
o multiplication:
 type “print 3*2” in python
 answer will come up in error display
 same rules as addition
 does not follow order of operations
o division:
 type “print 10/5” in python
 answer will come up in error display
 same rules as addition
o
o
o
o
 does not follow order of operations
modulus:
 gives the reminder of a division problem
 type “print 10%5” in python
 answer will come up in error display
 % means show the remainder
 can only handle integers
power:
 type “print 2**3” in python
 answer will come up in error display
 ** means “to the power of”
string concatenation
 print “hey” + “you”
 answer will come up in error display
 will display heyyou
 in order to combine strings with non-strings, use the operation “str()”
 ex. “hey”+str(5) = hey5