Python variables and operators quiz
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Brett Kottmann
Used 21+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
Which of the following is NOT a valid Python data type?
float
int
str
positive
2.
DRAG AND DROP QUESTION
20 sec • 5 pts
To test whether one number is greater than or equal to another, you would use the (a) conditional operator.
Answer explanation
To combine two operators, just put them next to each other. Thus "greater than or equal to" combines greater than (>) and equal (=): >=
3.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
Which of the following is a valid Python assignment statement?
x = 3
x := 3
x == 3
x <- 3
4.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
What is the correct Python syntax to output the type of a variable?
print(type(x))
print(typeof(x))
print(typeof x)
print(type x)
5.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
How do you insert COMMENTS in Python code?
// this is a comment
/* this is a comment */
# this is a comment
-- this is a comment
6.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
Which of the following is NOT a Python keyword?
for
while
loop
if
Answer explanation
7.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
Which of the following will prompt a user for input and assign that input to a variable?
x = input("Please enter your name: ")
x = get(input)
x = prompt("Enter your name: ")
x = "Please enter your name: "
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
KELAS 7 1
Quiz
•
9th - 12th Grade
15 questions
Data Security Worksheet
Quiz
•
10th Grade - University
20 questions
Visualisasi data
Quiz
•
8th Grade - University
17 questions
Bylos ir aplankai. Savarankiškas darbas 6 klasei.
Quiz
•
1st - 10th Grade
17 questions
Greenfoot
Quiz
•
10th - 12th Grade
20 questions
2324tx6
Quiz
•
9th - 12th Grade
25 questions
TIK01
Quiz
•
12th Grade
15 questions
# REVIEW 1 DATA TYPES
Quiz
•
10th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
