使用当前浏览器访问考试宝,无法享受最佳体验,推荐使用 Chrome 浏览器进行访问。
更新时间: 试题数量: 购买人数: 提供作者:
有效期: 个月
章节介绍: 共有个章节
我的错题 (0道)
我的收藏 (0道)
我的斩题 (0道)
我的笔记 (0道)
顺序练习 0 / 0
随机练习 自定义设置练习量
题型乱序 按导入顺序练习
模拟考试 仿真模拟
题型练习 按题型分类练习
易错题 精选高频易错题
学习资料 考试学习相关信息
简述 Python 语言的主要特点。
说明 Python 中列表、元组、字典的主要区别。
写出 Python 中三种基本控制结构,并举例说明用途。
简述 Python 中变量命名的规则。
列举文件打开模式 'r'、'w'、'a'、'r+'、'w+' 的区别。
简述 Python 中文件读写的基本步骤。
说明 Python 中字典和集合的本质区别。
函数参数传递有哪几种方式?简述区别。
for i in range(1, 6):
if i == 3:
continue
print(i, end=' ')
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sum_even = 0
for num in numbers:
if num % 2 != 0:
sum_even += num
print(sum_even)
def greet(name='客人'):
print('你好,', name)
greet()
greet('李四')
f = open('test.txt', 'r')
content = f.read()
f.close()
words = content.split()
print(len(words))
(假设 test.txt 文件内容为 "Python is a programming language")
try:
result = 10 / 0
except ZeroDivisionError:
print("除数不能为零!")
finally:
print("计算结束")
x = 5
y = 3
print(x ** y if x > y else x + y)
s = "Hello, World!"
print(s[::-1].lower())
def func(a, b=2):
return a * b
print(func(4) + func(5, b=3))
lst = [1, 2, 3, 2, 1]
print(len(set(lst)))
x = 10
while x > 0:
x -= 2
if x % 3 == 0:
print(x, end=' ')
lst = [1, 3, 2]
lst.append(4)
lst.sort()
print(lst)
def func(n):
if n == 0:
return 0
return n + func(n-1)
print(func(3))