Question 8: What is the output of the program below?
def power(x, y=2): r = 1 for i in range(y): r = r * x return r print power(3) print power(3, 3)
212 32
9 27
567 98
There is no right answer.
Question 9: What is the output of the program below?
def sum(*args): '''Hàm trả về tổng của các giá trị''' r = 0 for i in args: r += i return r print sum.__doc__ print sum(1, 2, 3) print sum(1, 2, 3, 4, 5)
6 15
6 100
123 12345
There is no right answer
Question 10: What is the output of the program below?
def printMax(a, b): if a > b: print(a, 'là số lớn nhất') elif a == b: print(a, 'bằng', b) else: print(b, 'là số lớn nhất') printMax(5, 6)