DEV Community

masoomjethwa
masoomjethwa

Posted on

Python functions

print - Prints a value to the console.
if - Conditional statement.
for - Loop statement.
while - Loop statement.
def - Function definition.
class - Class definition.
import - Imports a module.
list - Creates a list.
tuple - Creates a tuple.
dict - Creates a dictionary.
str - Converts a value to a string.
int - Converts a value to an integer.
float - Converts a value to a float.
bool - Converts a value to a boolean.
and - Logical AND.
or - Logical OR.
not - Logical NOT.
in - Checks if a value is in a sequence.
not in - Checks if a value is not in a sequence.
len - Gets the length of a sequence.
range - Creates a sequence of numbers.
slice - Gets a slice of a sequence.
lambda - Creates an anonymous function.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)