This is a draft cheat sheet. It is a work in progress and is not finished yet.
Data type
Interger |
Whole number/counting number |
Float |
The number in decimal |
String |
A list of character such as number, letter and symbols |
Boolean |
True/False |
Function
print() |
Show information that you want on the screen |
int() |
Change number to be number integer |
float() |
Change number to be decimal number |
input() |
Gain information 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 |
Grammar/Structure 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 |
|