// Functions

Functions Quiz

// question 1 of 10
What is printed? def f(x): if x>0: return ""P"" else: return ""N"" ; print(f(-1))?
// question 2 of 10
Can a local variable be used outside the function?
// question 3 of 10
What happens if too many arguments are passed?
// question 4 of 10
What is printed? def f(): print(""Hi"") ; print(f())?
// question 5 of 10
What is printed? try: print(int(""a"")) except ValueError: print(""Bad"")?
// question 6 of 10
What is printed? def f(x): return x*3 ; print(f(4))?
// question 7 of 10
What is printed? def f(x): if x>0: return ""P"" else: return ""N"" ; print(f(1))?
// question 8 of 10
What is printed? def greet(name): return ""Hi ""+name ; print(greet(""Ana""))?
// question 9 of 10
What is printed? def f(a,b): return a or b ; print(f(False,True))?
// question 10 of 10
What is printed? def cube(x): return x**3 ; print(cube(2))?