Show Menu
Cheatography

Python cheatSheet Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Data type

Interger
Whole number­­­/­c­o­­u­­nting number
Float
The number in decimal
String
A list of character such as number, letter and symbols
Boolean
True/False

Function

print()
Show inform­­­­­ation that you want on the screen
int()
Change number to be number integer
float()
Change number to be decimal number
input()
Gain inform­­­­­ation from user
str()
A list of number, letter and symbols
len()
The length of the string
#
Comment, no effect

Vocabulary

Varible
something that can change
String
a list of characters
Length
the length of the string
Syntax
Gramma­­r/­S­t­ru­­cture of language
Range (1-10)
the numbers 1-9
range(10)
the numbers 0-10
 

Spelling a string in reverse code.

word = input("Type in an word: ")
reverse = ""
for letter in word:
    reverse = letter + reverse
print ("Reverse: ", reverse)
 

Math

==
equal to
!=
not equal to
<
less than
>
more than
<=
less than or equal to
>=
more than or equal to
%
Find the remainder

Math

+
Add
-
Subtract
*
Multiply
/
Divide a float
//
Divide a interger
**
Expontent