
Python Variable - Quiz
Authored by Hafiz Putra
Information Technology (IT)
7th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
What is a correct way to declare a Python variable?
var x = 5
#x = 5
$x = 5
x = 5
2.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
True or False:
You can declare string variables with single or double quotes.
x = "John"
# is the same as
x = 'John'
3.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
True or False:
Variable names are not case-sensitive.
a = 5
# is the same as
A = 5
4.
FILL IN THE BLANKS QUESTION
1 min • 10 pts
Select the correct functions to print the data type of a variable:
(a) (type(myvar))
5.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Which is NOT a legal variable name?
my-var = 20
my_var = 20
Myvar = 20
_myvar = 20
6.
FILL IN THE BLANKS QUESTION
1 min • 10 pts
Create a variable named carname and assign the value Honda to it.
carname = (a)
7.
FILL IN THE BLANKS QUESTION
1 min • 10 pts
Create a variable named x and assign the value 50 to it.
(a)
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
Already have an account?