Python Unit 02 - Libraries and Variables

Quiz
•
Computers
•
6th - 9th Grade
•
Medium
Tom Riherd
Used 11+ times
FREE Resource
31 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You've been asked to write a program that asks a user for a value. The value must be used as a whole number in a calculation even if the user enters a decimal value. To help complete the code for this requirement, which code segment should you use?
total_items = float(input("How many items would you like?"))
total_items = input("How many items would you like?")
total_items = str(input("How many items would you like?"))
total_items = int(input("How many items would you like?"))
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Match the data type to the code segment containing it.
Which of the segment below would represent a type bool
age = 2
tiger = False
name = "Albert"
grade = 91.7
zip = "32054"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Match the data type to the code segment containing it.
Which of the segment below would represent a type int
age = 2
tiger = False
name = "Albert"
grade = 91.7
zip = "32054"
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Match the data type to the code segment containing it.
Which of the segment below would represent a type str
age = 2
tiger = False
name = "Albert"
grade = 91.7
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Match the data type to the code segment containing it.
Which of the segment below would represent a type float
age = 2
tiger = False
name = "Albert"
grade = 91.7
zip = "32054"
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
After running code segment 1 shown below, what will the data type of variable a be?
# Code segment 1
x1 = "20"
y1 = 3
a = x1 * y1
str
int
float
bool
none of these, code will produce an error instead.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
After running code segment 2 shown below, what will the data type of variable b be?
# Code segment 2
x2 = 6
y2 = 4
b = x2 / y2
str
int
float
bool
none of these, code will produce an error instead.
Create a free account and access millions of resources
Similar Resources on Wayground
26 questions
CS6 Final Exam Review 1

Quiz
•
6th Grade
30 questions
Python Introduction

Quiz
•
9th - 11th Grade
26 questions
AP CSP Unit 7: Parameters, Returns, and Libraries

Quiz
•
9th - 12th Grade
27 questions
CSE MID-TERM

Quiz
•
9th - 12th Grade
30 questions
DDS Final Exam Review 2

Quiz
•
7th Grade
31 questions
Python Quiz

Quiz
•
6th - 8th Grade
26 questions
Code.org: Unit 2 Lesson 1-13 Test

Quiz
•
6th - 8th Grade
27 questions
Java Swing/AWT Graphics

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
typing

Quiz
•
6th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade