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 代碼
刪除
恢復自動保存:
?