My cheat sheet for Grade10 Computer class
|
string*integer
|
repeat the string....times
|
|
string*string
|
CRASH
|
|
integer*integer
|
Do the math
|
|
string+string
|
connect the strings together
|
|
string+integer
|
CRASH
|
|
string**integer
|
CRASH
|
|
string**string
|
CRASH
|
|
a+b-c*d/(e+f)
|
parenthesis-->division-->multiplication-->subtraction-->addition
|
|
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.choice()
|
to choose randomly from a list
|
|
def
|
define a function
|
|
return
|
exit a function
|
|
return value
|
value that function give back
|
|
func(a<--)
|
argument/parameter
|
|
import
|
to import a existing function
|
|
break
|
to exit a loop
|
|
String
|
list of letters/symbol/numbers
|
|
Variable
|
value that can be changed
|
|
Integer
|
Whole number
|
|
Floating Point
|
Decimal
|
|
Syntax
|
Grammar/structure
|
|
Boolean
|
True/False
|
|
Start with letter (either uppercase or lower case)
|
|
Start with _
|
|
Contain only letters,numbers, or _
|
|
True or False
|
True
|
|
True and False
|
False
|
|
==
|
Equals to (compare/result=boolean)
|
|
<
|
less than
|
|
>
|
more than
|
|
!=
|
not equal to
|
|
+
|
addition
|
|
*
|
times/multipltcation
|
|
/
|
division(floating)
|
|
//
|
division(integer)
|
|
<=
|
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 command/value)
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.