National Youth Software Programming (Python) Level Examination Level 2 Exam Questions March 2023 - Continuous Update.....

Teenagers Software Programming (Python) Level Examination Paper (Level 2)
Score: 100 Number of Questions: 37
1. Multiple choice questions (25 questions in total, 50 points in total)
1. Which of the following statements is correct? ( )
A. {123:'a','a':123} is not a legal dictionary
B. Numbers, strings, lists and tuples can all be used as keys of dictionaries
C. {(12,34,'a' ):'a','a':5678} is a legal dictionary
D. The content in the dictionary cannot be modified once it is
created
A list cannot be used as a key of a dictionary; the contents of a dictionary can be modified after creation
2. What is the result of the following program? ( )
d1=dict(age=18)
print(d1)
A. (age=18)
B. [age=18]
C. age=18
D. {'age': 18}
Standard answer: D
Analysis of test questions: investigation Dictionary creation.
3.datas={'Name':'XiaoMing','No':'1001','Age':'14','School':'ShiYan XueXiao'}, what is the value of the expression len(datas)? ( )
A. 8
B. 6
C. 4
D.
2 Standard answer: C
Analysis of test questions:
4. Which of the following is a legal list? ( )

Guess you like

Origin blog.csdn.net/owbc_/article/details/131273578