+ 11
How I can learn more functions??
I wanna learn more functions in python language but sololearn doesn't have this much...so how should I learn??
8 Answers
+ 2
Jan Markus own function??...but how??
+ 2
Jan Markus thank you...
+ 1
If you wish, you can write your function. For example, you can write a function for addition. Let's write this function.
def addition(x,y):
z = x+y
return z
That's all. Then you can use this function while make a simple calculator
+ 1
1- try to read snippets of code written by another people
2- read books (python crash course and automate the boring stuff with python are highly recommended)
3- to dive deeper and learn more about this,search for functional programming topics
+ 1
Read More about functions !
+ 1
it should be noted that any values asigned to variables within the function will only have that value while the function is being run. if i have a variable, x which is equal to 2, and pass it through a function to give it a value of 1, unless I use return, the variable will still have a value of 2
+ 1
You may try learning about some in-built functions, w3schools being adequate for more information on that.