Cheatography
https://cheatography.com
basic
variable : |
comment : |
integers/floats = numbers |
single = #comment |
strings/text = characters |
multi = """comment""" |
boolean = true/false |
basic_2
+ 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)) |
len can't use toward number because it is for string only
string method ;
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
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 |
function
int() change number into integer |
float() change number into decimal |
input() ask for information from user |
str() A list of number, letter and symbols |
operation
== equal to |
!= no equal to |
< less than |
> more than |
<= less than equal |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment