Python - Sample Question
Python - Sample Question
COMPUTATIONAL OLYMPIAD
SAMPLE QUESTION – CÂU HỎI MẪU
1. What is output of –
33 == 33.0
A. True
B. False
C. 33
D. Error
E. None of the above
A. [19, 21]
B. [11, 15]
C. [11, 15, 19]
D. [13, 17, 21]
E. [13, 17, 19, 21]
A. Emma
25
B. name
age
C. 25
D. TypeError
E. None of the above
A. 20
B. 24
C. 30
D. 40
E. The program executed with errors
A. jam
B. dno
C. dnoBsemaj
D. maj
E. james
14. Which method can be used to remove any whitespace from both the beginning and the end of a string?
A. ptrim() B. trim() C. len() D. strip() E. None of the above
17. Choose the correct function declaration of fun1() so that we can execute the following function call
successfully
A. def fun1(*data)
B. def fun1(**kwargs)
C. def fun1(args*)
D. No, it is not possible in Python
E. None of the above
18. What is the output of the following code?
A. 10
B. 12
C. 1
D. 2
E. Syntax Error
20. . Given the nested if-else above, what will x become after the above statement is executed
~ End of Paper ~
KEY / ĐÁP ÁN
A B C D E A B C D E
1 ⚫ O O O O 11 O O O ⚫ O
2 O O ⚫ O O 12 ⚫ O O O O
3 O O ⚫ O O 13 O O ⚫ O O
4 O O O O ⚫ 14 O O O ⚫ O
5 O O O ⚫ O 15 O O ⚫ O O
A B C D E A B C D E
6 O ⚫ O O O 16 O O O O ⚫
7 O ⚫ O O O 17 ⚫ O O O O
8 O O ⚫ O O 18 O ⚫ O O O
9 O O ⚫ O O 19 O O O O ⚫
10 O O O O ⚫ 20 O O O ⚫ O