Show Menu
Cheatography

Cheat Sheet Cheat Sheet by

What will happen?

string­*in­teger
repeat the string­(in­teg­er)­times
string­*string
CRASH
intege­r*i­nteger
Do the math
string­+string
connect the strings together
string­+in­teger
CRASH
string­**i­nteger
CRASH
string­**s­tring
CRASH
a+b-c*­d/(e+f)
parent­­he­s­i­s-­­->d­­iv­i­s­io­­n--­­>m­u­l­ti­­pli­­ca­t­i­on­­-->­­su­b­t­ra­­cti­­on­-­-­>a­­ddition

Functi­ons­/co­mmands

print()
print/show info on the screen
int()
convert string to intregers
str()
convert numbers to string
float()
convert integers to decimal
input()
to gain info from the user
len()
the length of the string
import
to import an external program
random.ch­oice()
to choose randomly from a list
def
define a function
return
exit a function
return value
value that function give back
func(a­<--)
argume­nt/­par­ameter
import
to import a existing function
break
to exit a loop
continue
to continue the loop
 

Rules for creating a variable name

Start with letter (either uppercase or lower case)
Start with _
Contain only letter­s,n­umbers, or _

T/F rule

True or False
True
True and False
False

Defini­tions

String
list of letter­s/s­ymb­ol/­numbers
Variable
value that can be changed
Integer
Whole number
Floating Point
Decimal
Syntax
Gramma­r/s­tru­cture
Boolean
True/False

Calcul­ation symbols

==
Equals to (compa­re/­res­ult­=bo­olean)
<
less than
>
more than
!=
not equal to
+
addition
*
times/­mul­tip­ltc­ation
/
divisi­on(­flo­ating)
//
divisi­on(­int­eger)
<=
less than or equal to
>=
more than or equal to
**
exponents (to the power of...)
%__
Modulo (Find the remainder from dividing with __)
=
equals to (give comman­d/v­alue)
 

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.

          More Cheat Sheets by lunatic21beez

          Python Cheat Sheet MUIDS Cheat Sheet