-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPYTHON KEYWORDS.txt
More file actions
55 lines (55 loc) · 3.36 KB
/
PYTHON KEYWORDS.txt
File metadata and controls
55 lines (55 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
and ::A logical operator
as ::To create an alias
assert ::For debugging
break :To break out of a loop
class ::To define a class
continue:: To continue to the next iteration of a loop
def ::To define a function
del ::To delete an object
elif ::Used in conditional statements, same as else if
else ::Used in conditional statements
except ::Used with exceptions, what to do when an exception occurs
False ::Boolean value, result of comparison operations
finally ::Used with exceptions, a block of code that will be executed no matter if there is an exception or not
for ::To create a for loop
from ::To import specific parts of a module
global ::To declare a global variable
if ::To make a conditional statement
import ::To import a module
in ::To check if a value is present in a list, tuple, etc.
is ::To test if two variables are equal
lambda ::To create an anonymous function
None ::Represents a null value
nonlocal:: To declare a non-local variable
not ::A logical operator
or ::A logical operator
pass ::A null statement, a statement that will do nothing
raise ::To raise an exception
return ::To exit a function and return a value
True ::Boolean value, result of comparison operations
try ::To make a try...except statement
while ::To create a while loop
with ::Used to simplify exception handling
yield ::To end a function, returns a generator
seed() Initialize the random number generator
getstate():: Returns the current internal state of the random number generator
setstate():: Restores the internal state of the random number generator
getrandbits():: Returns a number representing the random bits
randrange() ::Returns a random number between the given range
randint() ::Returns a random number between the given range
choice():: Returns a random element from the given sequence
choices():: Returns a list with a random selection from the given sequence
shuffle():: Takes a sequence and returns the sequence in a random order
sample():: Returns a given sample of a sequence
random():: Returns a random float number between 0 and 1
uniform():: Returns a random float number between two given parameters
triangular():: Returns a random float number between two given parameters, you can also set a mode parameter to specify the midpoint between the two other parameters
betavariate():: Returns a random float number between 0 and 1 based on the Beta distribution (used in statistics)
expovariate() ::Returns a random float number between 0 and 1, or between 0 and -1 if the parameter is negative, based on the Exponential distribution (used in statistics)
gammavariate() ::Returns a random float number between 0 and 1 based on the Gamma distribution (used in statistics)
gauss() ::Returns a random float number between 0 and 1 based on the Gaussian distribution (used in probability theories)
lognormvariate():: Returns a random float number between 0 and 1 based on a log-normal distribution (used in probability theories)
normalvariate() ::Returns a random float number between 0 and 1 based on the normal distribution (used in probability theories)
vonmisesvariate():: Returns a random float number between 0 and 1 based on the von Mises distribution (used in directional statistics)
paretovariate() ::Returns a random float number between 0 and 1 based on the Pareto distribution (used in probability theories)
weibullvariate():: Returns a random float number between 0 and 1 based on the Weibull distribution (used in statistics)