Python variables and operators quiz

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Brett Kottmann
Used 20+ times
FREE Resource
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
Similar Resources on Wayground
15 questions
Grade 12-Python selection&iteration

Quiz
•
11th - 12th Grade
15 questions
Python Basics

Quiz
•
KG - University
20 questions
Python Programming Quiz

Quiz
•
9th Grade - University
19 questions
Program Development - Python: Operators

Quiz
•
9th - 10th Grade
20 questions
Data Science (Quiz in Python)

Quiz
•
11th Grade
20 questions
Python String

Quiz
•
12th Grade
20 questions
Ôn tập Python (for, if)

Quiz
•
10th Grade
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops

Quiz
•
9th Grade - University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade