|
variable
|
holds a value and can be changed
|
|
string
|
a list of characters such as numbers, letters, symbols
|
|
comment
|
The pieces of program text which are ignored by Python are called comments.
|
|
float
|
The type used to represent numbers with a fractional part.
|
|
string * number
|
combine that string multiple times
|
|
string * string
|
crash
|
|
number * number
|
math - multiply
|
|
string ** number
|
crash
|
|
=
|
assigns the value on the right to a variable on the left
|
|
==
|
Tests if two things have the same value
|
|
"""
|
quotes out everything beneath/after these triple quotes until it reaches another triple quotes
|
|
print (name.upper())
|
|
print (name.lower())
|
|
print (name.capitalize())
|
|
print (name.title())
|
|
string + string
|
combine together
|
|
string + number
|
crash
|
|
number + number
|
math - addition
|
|
true
|
True boolean value.
|
True or False == True
|
|
false
|
False boolean value.
|
False and True == False
|
|
non
|
Represents "nothing" or "no value".
|
x = None
|
|
string
|
Stores textual information.
|
x = "hello"
|
|
number
|
Stores integers.
|
i = 100
|
|
floats
|
Stores decimals.
|
i = 10.389
|
|
lists
|
Stores a list of things.
|
j = [1,2,3,4]
|
|
dicts
|
Stores a key=value mapping of things.
|
e = {'x': 1, 'y': 2}
|
|
print()
|
displays information on the screen
|
|
input()
|
receives information from the user
|
|
int()
|
converts a value to an integer
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.