wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 1 Module 1 Review

Total questions: 32

Worksheet time: 11mins

Name
Class
Date
1.

What Type of Cells Do Jupyter Notebooks Have

a)

Code Cells and Markdown Cells

b)

Markup Cells and Secret Cells

c)

Super Cells and Semi Super Cells

2.

What are the right ways to run a code cell in Jupyter Notebook?

a)

Shift + Enter

b)

Menu: Cell...> Run Cells

c)

Shift + R

d)

Ctrl + Enter

3.

What version of the Python Language are We Using

a)

Python 3

b)

Python 4

c)

Python 5

d)

Python Max

4.

Select all of the invalid python comments

a)

(comment) warnings can identify mistakes in code

b)

/* this is a comment */

c)

# The use of comments describe the code to the coder.

d)

{this is a comment I promise}

5.

Python strings can only contain letters

a)

True

b)

False

6.

Which line contains only integers?

a)

8,6,7,-3,5,0,9

b)

1,+,1,=, 3

c)

1.1,1.3,1.5,1.7,

d)

Z,I,O,N, , C,H,E,A,T,E,D

7.

Variables in Python can be initialized using the equals sign (=).

a)

True

b)

False

8.

A Variable Value in Python can not be updated

a)

True

b)

False

9.

What function determines the data type?

a)

Print()

b)

Type

c)

Print

d)

Type()

10.

What does type(1.23) return?

a)

Float

b)

All of the above

c)

Int

d)

Str

11.

What does type(2013) return?

a)

Float

b)

Int

c)

Str

d)

Error

12.

What does type("Mr. Dusek is the Best Python Teacher Ever!") return?

a)

All of the above

b)

Str

c)

Float

d)

Int

13.

Which operator allows you to add numbers and strings

a)

+

b)

,

c)

ADD()

d)

print(plus)

14.

What is an example of python string addition that will run with out error

a)

This_is_right="Carolina' + 'Panthers"

b)

This_is_wrong="Carolina" + "Panthers"

c)

Maybe_this_one= Carolina + Panthers

15.

What does the python code: goals = 7 + "89" result in?

a)

Seven ate nine!

b)

Type()

c)

96

d)

TypeError

16.

PrInT("mY MoMmA sAyS") will not provide an output, what will this result in?

a)

TypeError

b)

All of the Above

c)

SyntaxError

d)

NameError

17.

What data type does the input() function in Python return as?

a)

Str

b)

Int

c)

Float

d)
18.

What is the proper way to use the input () function in Python?

a)

Age = INPUT("HOW OLD ARE YOU:")

b)

Age = INPUT(HOW OLD ARE YOU:)

c)

Age = input("How old are you:")

d)

Age = input(how old are you:)

19.

age = input("how old are you:") print(10+answer)


If user input is 32, what is the output?

a)

TypeError

b)

SyntaxError

c)

1032

d)

42

20.

age = input("how old are you:")

print("You are"+ age)


If user input is 32, what is the output?

a)

You are answer

b)

SyntaxError

c)

You are 32

d)

TypeError

21.

we can combine strings and numbers (int & float) in a single Python print() function without a TypeError. By using what feature?

a)

Comma Separation

b)

Addition

c)

Input()

d)
22.

Select all of the improper formatted Python print() functions below

a)

print("Welcome the", 6, New programmers!)

b)

print("Welcome the", 6 + New programmers!)

c)

print("Welcome the", 3,"New programmers!")

d)

print("Welcome the", 3 + " New programmers!")

23.

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

a)

print(eric, '- that will be about $' cost, 'for the Loch Ness Monster')

b)

print(eric, "- that will be about $" , cost, "for the Loch Ness Monster")

c)

print("login_name", "- that will be about $", "cost", "for the Loch Ness Monster")

d)

print(login_name, "- that will be about $" , cost, " for the Loch Ness Monster")

24.

What will the output of the code below be?


print("I am", 32, "years old")

a)

I am32years old

b)

I am 32 years old

c)

"I am" 32 "years old"

d)
25.

Python can display quotes in strings using the print function.

a)
b)
c)
26.

Print("Stop, Hammer Time!")


What is the output of the code above?

a)

Stop, Hammer Time!

b)

Stop' Hammer Time!

c)

Stop Hammer Time!

d)

Error

e)
27.

"Grape Popsicle".isalpha()


What is the output of the code above?

a)

False

b)

True

c)

Yummy

d)

Error

28.

Height = "79"

Height.isalnum()


What is the output of the above code?

a)
b)
c)

Error

d)

79

29.

Football_team= "seminoles"

print(Football_team.swapcase())

a)

Seminoles

b)

SEMINOLES

c)

seminoles

d)

sEMINOLES

30.

Which code formats the string "Garnet" to "GARNET"?

a)

.capitalize()

b)

.isupper()

c)

.upper()

d)

.istitle()

31.

name = "tegridy farms"

name_1 = name.title()

name_2 = name_1.swapcase()

print(name_2)


What is the output of the code above?

a)

tEGRIDY FARMS

b)

TEGRIDY FARMS

c)

Tegridy Farms

d)

tegridy farms

32.

name = "BRUCE WAYNE"

print("w" in name.lower())

a)

True

b)

False

c)

bruce wayne

d)

7