NEW
Font size
WorksheetsPython Basics Quiz
Total questions: 16
Worksheet time: 8mins
下面哪个代码可以正确输出"Hello World"?
print(Hello World)
print 'Hello World'
print('Hello World')
Print('Hello World')
执行 print("3" + "5") 的结果是什么?
8
35
"8"
Error
input()函数的作用是什么?
输出信息到屏幕
从用户获取输入
进行数学计算
定义变量
执行 name = input("请输入姓名:") 后,如果用户输入"小明",变量name的值是?
name
"请输入姓名:"
"小明"
小明
执行 print("Python" * 2) 的结果是?
PythonPython
Python2
Error
Python Python
想要输出两个数的和,假设a=5, b=3,哪个代码是正确的?
print('a + b')
print(a + b)
print('5+3')
print(a, '+', b)
print("Score:", 95) 的输出结果是?
Score:95
Score 95
Score:,95
Score: 95
哪个选项可以让用户输入年龄并转换为整数?
age = input('Age:')
age = int('Age:')
age = int(input('Age:'))
age = input(int('Age:'))
在Python中,变量的作用是?
存储数据
输出信息
循环控制
条件判断
执行 x = 10; x = "hello"; print(x) 的结果是?
10
hello
10hello
Error
下面哪个是有效的变量名?
2nd_value
my-var
score
for
Python中,用于表示字符串的数据类型是?
int
float
str
char
执行 y = 7 // 2 后,y的值是?
3.5
3
4
3.0
哪个运算符用于求余数?
/
%
//
**
执行 num = 5; num += 3 后,num的值是?
5
8
3
15
下面哪个代码可以将字符串"25"转换为整数?
int = '25'
int(25)
int('25')
'25'.int()
