1) What is a correct way to declare a Python variable? a) var x = 5 b) #x = 5 c) $x = 5 d) x = 5 2) You can declare string variables with single or double quotes. a) True b) False 3) Variable names are not case-sensitive. a) True b) False 4) Which is NOT a legal variable name? a) my-var = 20 b) my_var = 20 c) Myvar = 20 d) _myvar = 20 5) How can we create a variable named carname and assign the value Volvo to it? a) carname = #Volvo b) carname = "Volvo" 6) How can we create a variable named x and assign the value 50 to it. a) _x = 50 b) x = 50 c) 'x' = 50 7) What is a correct syntax to add the value 'Hello World', to 3 values in one statement? a) x, y, z = 'Hello World' b) x = y = z = 'Hello World' c) x|y|z| = "Hello World" 8) Chose the correct syntax for assign values to multiple variables in one line: a) x, y, z = "Orange", "Apple", "Cherry" b) x + y + z = "Orange", "Apple", "Cherry" 9) What will be the result of a? a) apple b) banana c) cherry 10) Considering the following code, what will be the printed result? a) Hello, World b) Hello World c) HelloWorld 11) Considering the following code, what will be the printed result? a) a + b b) Hello World c) Helloworld 12) Considering the following code, what will be the printed result? a) 45 b) 9 c) 4+5 13) Considering the following code, what will be the printed result? a) Python is awesome b) Pyton is fantastic 14) What keyword we must to insert to make the variable x belong to the global scope. a) int b) global c) string 15) Considering the following code, what will be the printed result? a) Python is awesome b) Python is fantastic
0%
Python quiq test - Variables
共享
共享
共享
由
Bejancristinaelena
Gimnaziu
Info
Programare în Python
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?