Which one is NOT a legal variable name?
Python quiz

Quiz
•
Computers
•
10th Grade - Professional Development
•
Hard
Viraj Yeotikar
Used 26+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
my_var
Myvar
_myvar
my-var
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is the correct syntax to output the type of a variable or object in Python?
print(typeof(x))
print(type(x))
print(typeof x)
print(typeOf(x))
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which method can be used to remove any whitespace from both the beginning and the end of a string?
ptrim()
len()
strip()
trim()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A while loop in Python is used for what type of iteration?
indefinite
discriminant
definite
indeterminate
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these collections defines a LIST?
["apple", "banana", "cherry"]
{"apple", "banana", "cherry"}
("apple", "banana", "cherry")
{"name": "apple", "color": "green"}
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet:
a = ['foo', 'bar', 'baz', 'qux', 'corge']
while a:
if len(a) < 3:
break
print(a.pop())
print('Done.')
corge
qux
baz
corge
qux
baz
Done.
The snippet doesn’t generate any output.
corge
qux
baz
bar
foo
Done.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Will the print() statement on line 5 be executed in this case:
a = ['foo','bar','baz','qux','corge']
while a:
print(a.pop())
else:
print('Done.')
No
Yes
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
Bundlers

Quiz
•
12th Grade
15 questions
Knowledge Knockout[Quiz Round](2nd-4th years)

Quiz
•
University
15 questions
Python Basics

Quiz
•
KG - University
15 questions
Java Script Quiz

Quiz
•
9th - 12th Grade
10 questions
Python Dictionaries

Quiz
•
University
14 questions
PYTHON DICTIONARIES

Quiz
•
11th Grade
9 questions
Python

Quiz
•
University
15 questions
Week 7 Quiz

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University