A、 Python 中的 for 语句可以在任意序列上进行迭代访问,例如列表、字符串和元组
B、 循环可以嵌套使用,例如一个 for 语句中有另-个 for 语句,一个 while 语句中有一个 for 语句等
C、 在 Python 中没有 switch-case 的关键词,可以用 if...elif...elif...来等价表达
D、 在 Python 中 if...elif...elif...结构中必须包含 else 子句
答案:D
A、 Python 中的 for 语句可以在任意序列上进行迭代访问,例如列表、字符串和元组
B、 循环可以嵌套使用,例如一个 for 语句中有另-个 for 语句,一个 while 语句中有一个 for 语句等
C、 在 Python 中没有 switch-case 的关键词,可以用 if...elif...elif...来等价表达
D、 在 Python 中 if...elif...elif...结构中必须包含 else 子句
答案:D
A. 顺序结构
B. 循环结构
C. 分支结构
D. 限制结构
A. {'py123'}
B. {‘p’,’y’,’p’,’y’,’1’,’2’,’3’}
C. {'pypy123'}
D. {‘1’,’p',’2’,’3',’y’}
A. print(not bool(input()% 2))
B. print(int(input())%2!=0)
C. print(int(input())% 2 == 1)
D. print(not bool(int(input())% 2))
A. {:2f}
B. {:.2f}
C. i.2f}
D. {.2}
A. import
B. True
C. if
D. While
A. dict1 ={}
B. dict3=dict([2,5],[3,4])
C. dict2={3 :5 }
D. dict4= dict(( [1,2],[3,4]))
A. lst[2:3]
B. lst.index(2)
C. st.count(2)
D. lst.pop(2)
A. (12,34, 56,78)
B. [12, 34, 56, 78]
C. 程序出错
D. (12,34,56,(78))
A. 追加写、读
B. 只读、写
C. 覆盖写、读
D. 创建写、读
A. s.title()
B. s.isupper()
C. s.upper()
D. s.capitalize()