Python Sheet Cheat Sheet

A Programming › Python cheat sheet in English by Wealth
2,028 views 1,247 downloads 11 Feb 2016 History
3.7 avg · 0 ratings

Function

str()
create string
int()
create intege­r,n­umber without decimal
float()
change to decimal
len()
length of string
input()
use can insert info.
print()
show,print the result
#
commen­t,s­ingle line
"­"­"...."""
commen­t,many line

string concat­enate

"­xx"
inside quotation = string
"­F"+"A­"
string combined = "­FA"
"­6"
interger inside quotation = string

Calcul­ation

+
plus int, or concat­enate
-
minus,­int­,float using only
*
multip­lic­ation
'­str­ing­'*10
string will be appears ten time.
**
power of....
%
modulo, remainder

Operation

==
equal to, not =
>=
greater than or equal to
<=
smaller than or equal to
!=
not equal to
>
greater than
<
less than

If,eli­f,else

If
beginning
elif
use after if, only run when if not match
else
everything not match = this will run

Badges

Good Cheat Sheet

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.