1) What will this code print? a) PythonPython b) Python*2 c) Python2 d) Python 2) What is the main difference between a procedure and a function in Python? a) A procedure can return a value b) A function can return a value c) A function takes parameters d) A procedure takes parameters 3) Which keyword is used to define a function in Python? a) def b) define c) function d) func 4) What will this function return? a) 34 b) xy c) x + y d) 7 5) What is a parameter in a function? a) A variable returned by the function b) The value passed to a function c) The function name d) A placeholder variable inside the function definition 6) What is an argument in Python functions? a) The value you pass into a parameter when calling a function b) A variable inside a function c) The value returned by a function d) A loop condition 7) What will this code output? a) Hello b) Hello name c) Hello Sam d) Sam 8) What is the return type of this function? a) str b) bool c) int d) True 9) Which of these correctly defines a function with two parameters? a) def myFunc(a, b): b) def myFunc(a b): c) def myFunc(a + b): d) def myFunc(ab): 10) What will this code output? a) n b) 5 c) 55 d) 25

Python Functions Quiz

Edetabel

Visuaalne stiil

Valikud

Vaheta malli

Kas taastada automaatselt salvestatud ?