Functions
Level: Beginner
Functions are blocks of code that can be accessed from any part of your program no matter the order of the code in question. Python has many inbuilt functions such as.
max()
print()
input()
string()
int()
bytes()
bool()
filter()
And many more. The following functions are just examples and don't even come close to the amount that fully exist. If you look at the end of each function you can see the parenthesis which if you put a variable into, it will execute the function using that data. You can create a fucntion using the def operator.
By adding the the variable myvariable it has been defined and is now usable in the function. To execute the function simply type:
Last updated
Was this helpful?