Python 3 Beginner's Reference Cheat Sheet http://www ...
Alvaro Sebastian
Python 3 Beginner's Reference Cheat Sheet
Main data types
List operations
boolean = True / False
integer = 10
float = 10.01
string = ¡°123abc¡±
list = [ value1, value2, ¡ ]
dictionary = { key1:value1, key2:value2, ¡}
Numeric
operators
+
*
/
**
%
//
addition
subtraction
multiplication
division
exponent
modulus
floor division
Boolean
operators
and
or
not
logical AND
logical OR
logical NOT
list = []
list[i] = x
list[i]
list[-1]
list[i:j]
del list[i]
Comparison
operators
defines an empty list
stores x with index i
retrieves the item with index I
retrieves last item
retrieves items in the range i to j
removes the item with index i
Dictionary operations
List methods
list.append(x)
adds x to the end of the list
list.extend(L)
appends L to the end of the list
list.insert(i,x)
inserts x at i position
list.remove(x)
removes the first list item whose
value is x
removes the item at position i and
returns its value
removes all items from the list
list.pop(i)
list.clear()
==
equal
dict = {}
defines an empty dictionary
!=
different
dict[k] = x
stores x associated to key k
>
higher
dict[k]
retrieves the item with key k
<
lower
list.sort()
returns a list of values delimited
by x
returns a string with list values
joined by S
sorts list items
del dict[k]
removes the item with key k
>=
higher or equal
list.reverse()
reverses list elements
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- strings ncert
- the software development process python programming an
- strings lists sets dictionaries and files 4 1 strings
- introduction to the burrows wheeler transform and fm index
- lecture 8 motifs and motifs finding
- python 3 beginner s reference cheat sheet http www
- programming in python 3 smu
- ppyytthhoonn ssttrriinnggss tutorialspoint
- 6 5 2019 william mary
- strings and pattern matching purdue university