1) What is Python? a) A kind of snake b) A video game c) A programming language d) A robot 2) What is an algorithm? a) A secret code b) A sequence of actions to solve a task c) A drawing d) A computer virus 3) What does a program do? a) Makes music b) Draws shapes c) Runs an algorithm written in a programming language d) Builds houses 4) What does print("Hello") do in Python? a) Sends an email b) Prints paper c) Writes “Hello” on the screen d) Draws a picture 5) print(2 + 3 * 4) a) 20 b) 14 c) 24 d) 10 6) print((2 + 3 )* 4) a) 20 b) 14 c) 24 d) 10 7) What is a variable? a) It like an storage box in Python b) A secret number c) A game d) A password 8) Which is a good variable name? a) a b) number_of_students c) 3price d) print 9) What does the input() function do? a) Prints a message b) Gets information from the keyboard c) Calculates math d) Sends an SMS 10) Which functions are used to switch from one data type to another? a) input() b) str() functions are used to switch from one data type to another. c) int() d) print() 11) What is the output of this code? a) 105 b) 500 c) 100 d) 5 12) What does int("42") do? a) Turns the number into a string b) Makes a letter c) Turns the text(string) "42" into the number 42. d) Deletes the number 13) What is the output ? a) 1518 b) 43 c) 33 d) 11111 14) What is the output ? a) 10 b) 54 c) 9 d) 11 15) What is the correct way to convert user input to a number? a) str(input()) b) input() c) int(input()) d) float('input') 16) What happens if you try int('hello') in Python? a) A. It returns 0 b) B. It returns 'hello' c) C. It prints hello d) D. It gives an error 17) 3. What type of value does input() always return? a) 3. What type of value does input() always return? b) A. Integer c) B. Float d) C. String 18) print('12' + '34') a) What is the result of: print('12' + '34')? b) A. 46 c) B. 1234 d) C. 12 + 34 19) What is the result of: print(12 + int('34'))? a) A. 46 b) B. 1234 c) C. Error d) D. 12 + 34 20) Mark the programs without errors. a) b) c) both of them False 21) Choose the actions that this program performs. a) The program works with variables b) The program uses functions to input and output data c) The program prints calculation results d) The program prints text prompts for the user
0%
Introduction to Python Programming
共享
共享
共享
由
Hejaclk
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?