香港中學文憑資訊及通訊科技 模擬試卷及多項選擇題
1. D 2. D Variable names cannot use Python keywords; variable names cannot start with a digit; variable names can only consist of digits, English letters, and underscores (0-9, A-z, and _). 3. D 4. C In Python programs, variable names are case-sensitive, meaning that uppercase and lowercase letters are considered different. 5. D Variables cannot have spaces in their names. 6. B x, y, z = 7,500,000 x = 7, y = 500, z = 0 x + y + z = 7 + 500 + 0 = 507 7. D 8. D 9. D 10. D 11. B X // Y retrieves the quotient of X divided by Y ; X mod Y is not a valid Python operator. 12. D 13. B 14. A In the print() function, combining numbers and strings using the + operator will result in an error. 15. C Line 3: num1 = 3+7 = 10 Line 4: num2 = 10-7 = 3 Line 5: num3 = 10*3 = 30 16. B 5 ** 2 – 2 23 ; 5 % 2 – 2 -1 ; 5 // 2 – 2 0 ; 5/2 -2 0.5 17. C 18. A The ** operator has a higher precedence than the * operator, so 1**3 will be executed first, resulting in 5*1*2=10 19. C 19+13//1**2 19+13//1 19+13 32 12+2**3%5 12+8%5 12+3 15 20. B 21. A 22. B In Python programs, 2.99//2 = 1.0 , int(3.99)%2 = 1 , Adding these two results together produce 2.0 23. C 24. D 25. C Option (1): data type is string
Made with FlippingBook
RkJQdWJsaXNoZXIy ODY0MTQz