香港中學文憑資訊及通訊科技 模擬試卷及多項選擇題
9. What is the output of the following Python program? x = "UP" *2*2 print(x, end="") print("EPHK") A. UP4EPHK B. UP22EPHK C. UP*2*2EPHK D. UPUPUPUPEPHK 10. What is the output of the following Python program? a = 99 b = 9 z = 1 x = str(a) y = str(b) print( x + y, z) A. 108 1 B. 999 C. 1000 D. 999 1 11. The following program is used to find the power of X to the Y . Which of the following options is the appropriate content for the blank space? print( ) A. X >= Y B. X ** Y C. X // Y D. X mod Y 12. Which two values of x will be the same in the following options? (1) x = 15 % 6 (2) x = 30 // 2 (3) x = 12 / 3 (4) x = 5 * 3 A. (1) and (2) only B. (1) and (3) only C. (2) and (3) only D. (2) and (4) only 13. Which of the following Python program statements will produce the same output? (1) print(4/3*(2+1)) (2) print(4/(3*2+1)) (3) print((4/3)*(2+1)) A. (1) and (2) only B. (1) and (3) only C. (2) and (3) only D. (1), (2) and (3) 14. Which of the following Python programs will generate an error? A. x = 99 y = "Python" print(x + y) B. x = 99 y = "Python" print(x + x) C. x = 99 y = "Python" print(x , y) D. x = 99 y = "Python" print(y + y)
Made with FlippingBook
RkJQdWJsaXNoZXIy ODY0MTQz