1.
- 2
- 4
- 4.3
- Compiler error
Q6: What is the output of the following code?
a = 10
c = 3
def foo(a, b):
b += a
return bar(b, c)
def bar(alpha, beta):
return alpha // beta
result = foo(2, 4)
print(result)
a = 10
c = 3
def foo(a, b):
b += a
return bar(b, c)
def bar(alpha, beta):
return alpha // beta
result = foo(2, 4)
print(result)
def alpha(var1):
return var1 - 5
def beta(var1):
return var1 * var1
my_var = 3
result = alpha(beta(my_var))
print(result)
a = 3
b = 4
def foo(a, b=10, c=3, d=1):
return (a - d) // ( b + c )
c = 1
result = foo(13, 1, c=2)
print(result)
def foo(alpha, beta=3, gamma=5):
beta += gamma
return beta / alpha
beta = 5
result = foo(4, gamma=1)
print(result)
a = 1
def hello():
return "Hello " * a
a = 3
result = hello()
print(result)