Python Code Notes 2
Integer = 1,-11,300000
Float=0.3,-8.3,1.22
String=”5”, “-20.2331”, “beep”
type(variable) tells you what type of variable it is. Aka type (‘hello”) gives
class ‘str’
type conversion, int(2.3) gives 2. int(“109.3”) gives an error. Float(“109.3”0
gives 109.3. str(2+3) gives ‘5’
\n = newline
\t = horizontal spacing
=! Not equal
+=
a//b = 2 a=5 b=12
x= x+a x+=a
% is mod, remainder after dividing left by right, also means a smaller
number divided by a larger number is the same initial number.
** square
// takes what isn’t the remainder after division 15/10=1
Name= input(“Enter your name: “)
Conditionals take a True or False path, are Boolean Expressions
And, both have to be true
Or, either one have to be true