|
variable :
|
comment :
|
|
integers/floats = numbers
|
single = #comment
|
|
strings/text = characters
|
multi = """comment"""
|
|
boolean = true/false
|
|
|
+ addition
|
output : print()
|
|
- subtraction
|
assigning strings : using "..."
|
|
* multiplication
|
string placement : 1st letter = 0
|
|
/ division
|
print multiple variables : using comma
|
|
** to the power of
|
length : how many symbols are used ex. len(cat)
|
|
% modulo
|
blank space counts as a character
|
|
ex : dog = "small puppy"
|
|
|
print (len(dog))
|
|
upper = capital letter ; upper()
|
|
ex. print (cat.upper())
|
|
lower = small letter ; lower()
|
|
ex. print (cat.lower())
|
|
str = make into string
|
|
ex. x = 47
|
|
y = str(x)
|
|
dot notation can use only string
|
|
concatenation = joining multiple strings together
|
|
ex. phrase = "Task" + "is" + "balding"
|
|
print (phrase)
|
|
output = TaskisBalding
|
|
!!!!Note!!! gaps/spaces
|
|
phrase = "Task " + "is " + "balding"
|
|
print (phrase)
|
|
output = Task is Balding
|
|
int() change number into integer
|
|
float() change number into decimal
|
|
input() ask for information from user
|
|
str() A list of number, letter and symbols
|
|
== equal to
|
|
!= no equal to
|
|
< less than
|
|
> more than
|
|
<= less than equal
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.