Can someone explain to me how to find the code behind functions that allow them to work. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone explain to me how to find the code behind functions that allow them to work.

I would like to build my own functions

19th Feb 2018, 5:33 AM
Wonjae Chang
Wonjae Chang - avatar
1 Answer
0
Hey Wonjae Chang ,👋 Please specify which language? If you want create your function in Python, you shoud use 'def' keyword to define a function and then type the name of your function and insert ':' after name. Then, for body of your function, you must use indentation. See below example: def func1(): print("Hello Wonjae Chang"*5) This function nemed: func1 and show 'Hello Wonjae Chang' five times in output.this function does not any arguments. Tip:arguments must be inserted inside the parenthesis of function. For call your function, do this: func1() Also, you can see my simple function in Python at: https://code.sololearn.com/c5IcvUR3dpKp/?ref=app
13th Jun 2018, 12:14 PM
Root
Root - avatar