Show Menu
Cheatography

magic cheat by

basic cheat

 
variable :
comment :
intege­­rs­/­f­loats = numbers
single = #comment
string­­s/text = characters
multi = "­­"­"­­com­­me­n­t­"­"­"
boolean = true/false

function

 
int() change number into integer
float() change number into decimal
input() ask for inform­­ation from user
str() A list of number, letter and symbols
 

concat­enation

 
concat­­en­ation = joining multiple strings together
ex. phrase = "­­Ta­s­k­" + "­­is­" + "­­ba­l­d­in­­g"
print (phrase)
output = Taskis­­Ba­lding
!!!!No­­te!!! gaps/s­­paces
phrase = "Task " + "is " + "­­ba­l­d­in­­g"
print (phrase)
output = Task is Balding

string method

 
upper = capital letter ; upper()
ex. print (cat.u­­pp­er())
lower = small letter ; lower()
ex. print (cat.l­­ow­er())
str = make into string
ex. x = 47
y = str(x)
dot notation can use only string
 

basic math

 
+ addition
output : print()
- subtra­­ction
assigning strings : using "..."­­
* multip­­li­c­ation
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))
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.