Font size
WorksheetsUnit 1 Module 1 Review
Total questions: 32
Worksheet time: 11mins
What Type of Cells Do Jupyter Notebooks Have
Code Cells and Markdown Cells
Markup Cells and Secret Cells
Super Cells and Semi Super Cells
What are the right ways to run a code cell in Jupyter Notebook?
Shift + Enter
Menu: Cell...> Run Cells
Shift + R
Ctrl + Enter
What version of the Python Language are We Using
Python 3
Python 4
Python 5
Python Max
Select all of the invalid python comments
(comment) warnings can identify mistakes in code
/* this is a comment */
# The use of comments describe the code to the coder.
{this is a comment I promise}
Python strings can only contain letters
True
False
Which line contains only integers?
8,6,7,-3,5,0,9
1,+,1,=, 3
1.1,1.3,1.5,1.7,
Z,I,O,N, , C,H,E,A,T,E,D
Variables in Python can be initialized using the equals sign (=).
True
False
A Variable Value in Python can not be updated
True
False
What function determines the data type?
Print()
Type
Type()
What does type(1.23) return?
Float
All of the above
Int
Str
What does type(2013) return?
Float
Int
Str
Error
What does type("Mr. Dusek is the Best Python Teacher Ever!") return?
All of the above
Str
Float
Int
Which operator allows you to add numbers and strings
+
,
ADD()
print(plus)
What is an example of python string addition that will run with out error
This_is_right="Carolina' + 'Panthers"
This_is_wrong="Carolina" + "Panthers"
Maybe_this_one= Carolina + Panthers
What does the python code: goals = 7 + "89" result in?
Seven ate nine!
Type()
96
TypeError
PrInT("mY MoMmA sAyS") will not provide an output, what will this result in?
TypeError
All of the Above
SyntaxError
NameError
What data type does the input() function in Python return as?
Str
Int
Float
What is the proper way to use the input () function in Python?
Age = INPUT("HOW OLD ARE YOU:")
Age = INPUT(HOW OLD ARE YOU:)
Age = input("How old are you:")
Age = input(how old are you:)
age = input("how old are you:") print(10+answer)
If user input is 32, what is the output?
TypeError
SyntaxError
1032
42
age = input("how old are you:")
print("You are"+ age)
If user input is 32, what is the output?
You are answer
SyntaxError
You are 32
TypeError
we can combine strings and numbers (int & float) in a single Python print() function without a TypeError. By using what feature?
Comma Separation
Addition
Input()
Select all of the improper formatted Python print() functions below
print("Welcome the", 6, New programmers!)
print("Welcome the", 6 + New programmers!)
print("Welcome the", 3,"New programmers!")
print("Welcome the", 3 + " New programmers!")
Given the code below and entering "Eric" for login_name input:
Python3
cost= 3.50
login_name=input("Enter your name: ")
What print statement will output:
Eric - that will be about $ 3.50 for the Loch Ness Monster
print(eric, '- that will be about $' cost, 'for the Loch Ness Monster')
print(eric, "- that will be about $" , cost, "for the Loch Ness Monster")
print("login_name", "- that will be about $", "cost", "for the Loch Ness Monster")
print(login_name, "- that will be about $" , cost, " for the Loch Ness Monster")
What will the output of the code below be?
print("I am", 32, "years old")
I am32years old
I am 32 years old
"I am" 32 "years old"
Python can display quotes in strings using the print function.
Print("Stop, Hammer Time!")
What is the output of the code above?
Stop, Hammer Time!
Stop' Hammer Time!
Stop Hammer Time!
Error
"Grape Popsicle".isalpha()
What is the output of the code above?
False
True
Yummy
Error
Height = "79"
Height.isalnum()
What is the output of the above code?
Error
79
Football_team= "seminoles"
print(Football_team.swapcase())
Seminoles
SEMINOLES
seminoles
sEMINOLES
Which code formats the string "Garnet" to "GARNET"?
.capitalize()
.isupper()
.upper()
.istitle()
name = "tegridy farms"
name_1 = name.title()
name_2 = name_1.swapcase()
print(name_2)
What is the output of the code above?
tEGRIDY FARMS
TEGRIDY FARMS
Tegridy Farms
tegridy farms
name = "BRUCE WAYNE"
print("w" in name.lower())
True
False
bruce wayne
7
