Show Menu
Cheatography

python eieis Cheat Sheet by

vocaburary

variable
holds a value and can be changed
string
a list of characters such as numbers, letters, symbols
comment
The pieces of program text which are ignored by Python are called comments.
float
The type used to represent numbers with a fractional part.

Multip­­li­c­ation and Exponents

string * number
combine that string multiple times
string * string
crash
number * number
math - multiply
string ** number
crash
 

symbol

=
assigns the value on the right to a variable on the left
==
Tests if two things have the same value
"­­"­"
quotes out everything beneat­­h/­after these triple quotes until it reaches another triple quotes

code

print (name.u­pp­er())
print (name.l­ow­er())
print (name.c­ap­ita­lize())
print (name.t­it­le())

Addition

string + string
combine together
string + number
crash
number + number
math - addition
 

data type

true
True boolean value.
True or False == True
false
False boolean value.
False and True == False
non
Represents "­not­hin­g" or "no value".
x = None
string
Stores textual inform­ation.
x = "­hel­lo"
number
Stores integers.
i = 100
floats
Stores decimals.
i = 10.389
lists
Stores a list of things.
j = [1,2,3,4]
dicts
Stores a key=value mapping of things.
e = {'x': 1, 'y': 2}

function

print()
displays inform­­ation on the screen
input()
receives inform­­ation from the user
int()
converts a value to an integer
 

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.