2023.05.20 Youth Software Programming (Python) Examination Paper (Level 5)

2023.05.20 Youth Software Programming (Python) Examination Paper (Level 5)
1. Multiple choice questions (25 questions in total, 50 points in total)
1. There is a list L=['UK','china','lili'," Zhang San "], what is the result of print(L[-2])? ( C )
A. UK
B. 'lili', 'Zhang San'
C. lili
D. 'UK', 'china', 'lili'

2. Countdown is widely used in daily life. Python uses range to implement reverse ordinal numbers. Which of the following statements can correctly output positive integers within 15 in reverse order? ( D )
A. print(list(range(15, -1, 1)))
B. print(list(range(-1, 15, 1)))
C. print(list(range(15, 1, - 1)))
D. print(list(range(15, 0, -1)))

3. A string s="iloveyou" is known. Construct a new list li=['i', 'oveyou'] by manipulating this string. Which of the following options cannot construct a new list li? ( A )
A.li = s.split("l",0)
B.li = s.split("l",1)
C.li = s.split("l",2)
D.li = s .split(&

Guess you like

Origin blog.csdn.net/lybc2019/article/details/131191191