Cheatography
https://cheatography.com
Multiplication and Exponents
string * number |
combine that string multiple times |
string * string |
crash |
number * number |
math - multiply |
number ** number |
math - exponents string ** number crash |
string ** number |
crash |
code
print (name.upper()) |
print (name.lower()) |
print (name.capitalize()) |
print (name.title()) |
Function
print() |
displays information on the screen |
input() |
receives information from the user |
int() |
converts a value to an integer |
|
|
Vocabulary
variable |
holds a value and can be changed |
string |
a list of characters such as numbers, letters, symbols |
floating point |
number include decimal number |
integer |
number that not include decimal number |
Syntax |
Grammar or the structure of language |
Modulo |
Find a remainder |
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 |
import random + random.choice() |
pick random item in the list |
|
|
symbol
+ |
add |
- |
minus |
* |
multiply |
/ |
divide |
= |
equal |
=! |
not equal |
> |
more than |
< |
less than |
=> |
more than or equal to |
=< |
less than or equal to |
" " |
quotation mark |
** |
power to |
% |
Modulo, Find the remainder |
Addition
string + string |
combine together |
number + number |
math |
String + number |
crash |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment