needing help with a test (python) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

needing help with a test (python)

Fill in the blanks to pass the function "square" as an argument to the function "test": square(x): return x * x def test(func, x) print(func(x)) test( , 42)

29th Feb 2020, 5:02 PM
Badee Barbarasker
Badee Barbarasker - avatar
4 Answers
+ 5
You have lots of blank spaces in your question ;) You can pass the name of the function plainly just as any parameter. test(square, 42)
29th Feb 2020, 5:35 PM
Tibor Santa
Tibor Santa - avatar
+ 4
def square(x): return x * x def test(func, x): print(func(x)) test(square, 42)
14th Jul 2020, 8:48 AM
Ethan
+ 1
def : square
11th Feb 2021, 6:03 PM
Md Momin Uddin Hridoy
Md Momin Uddin Hridoy - avatar
+ 1
def : square
8th Aug 2022, 12:12 PM
wessam lahmod nados