Python Cheat Sheet
Python Cheat Sheet
com
OverAPI.com Python jQuery NodeJS PHP Java Ruby Javascript ActionScript CSS Express More » Search
https://overapi.com/python 1/3
10/05/2023, 18:01 Python Cheat Sheet | OverAPI.com
a[1:] [1,2,3,4,5] Power and Logarithmic
OverAPI.com
a[:5] Python jQuery
[0,1,2,3,4] NodeJS Random
PHPJava Ruby Javascript
exp(x)ActionScript CSS Express
setdefault(key[, default])
More »
update([other]) Sys
a[:-2] [0,1,2,3] log(x[,base]) values
Functions Sys Variables
a[1:3] [1,2] log1p(x)
seed([x])
log10(x) argv
a[1:-1] [1,2,3,4] getstate() Command line args
pow(x,y)
b=a[:] Shallow copy of a setstate(state)
sqrt(x) builtin_module_names
jumpahead(n)
getrandbits(k)
OS Linked C modules
byteorder
Trigonometric Functions
randrange([start], stop[, step]) os Variables Native byte order
acos(x)
randint(a,b) altsep check_-interval
Class choice(seq)
shuffle(x[,random])
asin(x)
atan(x) Alternative sep Signal check frequency
atan2(y,x) curdir exec_prefix
Special Methods sample(population,k) Root directory
cos(x) Current dir string
__new__(cls) random() executable
uniform(a,b)
hypot(x,y) defpath
__lt__(self, other) sin(x) Default search path Name of executable
__init__(self, args) triangular(low,high,mode)
tan(x) devnull exitfunc
betavariate(alpha,beta)
__le__(self, other) expovariate(lambd) Path of null device Exit function name
__del__(self) Angular Conversion extsep modules
gammavariate(alpha,beta)
__gt__(self, other) degrees(x) Extension separator Loaded modules
gauss(mu,sigma)
__repr__(self) lognormvariate(mu,sigma)
radians(x) linesep path
Line separator Search path
__ge__(self, other) normalvariate(mu,sigma)
vonmisesvariate(mu,kappa)
Hyperbolic Functions name platform
__str__(self) acosh(x) Current platform
paretovariate(alpha) Name of OS
__eq__(self, other) asinh(x) stdin, stdout, stderr
weibullvariate(alpha,beta) pardir
__cmp__(self, other) atanh(x) Parent dir string File objects for I/O
__ne__(self, other) cosh(x) pathsep version_info
__index__(self) sinh(x) Python version info
__nonzero__(self) String tanh(x)
Patch separator
sep winver
__hash__(self) Version number
__getattr__(self, name) Formatting Constants
Path separator
https://overapi.com/python 2/3
10/05/2023, 18:01 Python Cheat Sheet | OverAPI.com
'E' Day (leading zeros) (01 to 31)
OverAPI.com Python jQuery NodeJS PHPexponential
Floating point Java Rubyforma Javascript ActionScript CSS Express More
%H »
t (uppercase). 24 hour (leading zeros) (00 to 2
'f' 3)
Floating point decimal format. %I
'F' 12 hour (leading zeros) (01 to 1
Floating point decimal format. 2)
'g' %j
Floating point format. Uses low Day of year (001 to 366)
ercase exponential format if exp %m
onent is less than -4 or not less Month (01 to 12)
than precision, decimal format o %M
therwise. Minute (00 to 59)
'G' %p
Floating point format. Uses upp AM or PM
ercase exponential format if exp %S
onent is less than -4 or not less Second (00 to 61?)
than precision, decimal format o
therwise.
%U
Week number1 (00 to 53)
'c'
Single character (accepts integ
%w
er or single character string). Weekday2 (0 to 6)
'r' %W
String (converts any Python obj Week number3 (00 to 53)
ect using repr(). %x
's' Date
String (converts any Python obj %X
ect using str() Time
'%' %y
No argument is converted, resul Year without century (00 to 99)
ts in a '%' character in the resul %Y
t. Year (2008)
%Z
Time zone (GMT)
%%
A literal "%" character (%)
https://overapi.com/python 3/3