Quiz
What is the output of the given code?
do_something('a')
def do_something(name): print(name)
What is the output of the given code?
def do_something(num): if num == 0: return None return num
b = do_something(10) print(b)
What is the output of the given code?
def do_something(a, b): print(a + b)
do_something(10, 20, 30)
What is the output of the given code?
def do_something(*a): print(a[1] + a[2])
do_something(10, 20, 30)
What is the output of the given code?
def do_something(a): return a * 2 print(a)
b = do_something(10) print(b)
What is the output of the given code?
def do_something(a, b=10, c): return a * b * c
b = do_something(1, 2) print(b)
What is the output of the given code?
def do_something(a, b): if (a > b): print('hi') else: print('hello')
do_something(b=1, a=2)
What is the output of the given code?
def do_something(a, b): if (a > b): print('hi') else: print('hello')
do_something(b=1, c=2)
What is the output of the given code?
def do_something(a, b=10): print(b, a)
do_something('a'=5)
##Exercise