Functions and Outputs (Review)
Flashcard
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

10 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Which of the following programs will NOT cause an error?
say_hi("Margaret")
def say_hi(name):
print("hi " + name)
function say_hi(name):
print("hi " + name)
def say_hi(first_name="John", last_name="Doe"):
print("hi " + first_name + " " + last_name)
say_hi("Polly Pocket"))
def say_hi(first_name="John", last_name):
print("hi " + first_name + " " + last_name)
say_hi(‘Polly’, ‘Pocket’)
Back
say_hi("Margaret")
def say_hi(name):
print("hi " + name)
2.
FLASHCARD QUESTION
Front
Which of the programs below will print the following output? I would like a green balloon.
Back
def balloon_choice(color):
print("I would like a " + color + " balloon.")
balloon_choice("green")
3.
FLASHCARD QUESTION
Front
What will be the output of the following program?
a = 4
def print_something():
a = "code"
print(a * 3)
print_something()
Back
codecodecode
4.
FLASHCARD QUESTION
Front
What will be the output of the following program?
name = “Tracy”
def print_hello(name):
name = "Turtle"
print(“hello ” + name)
print_hello(name)
Back
hello Turtle
5.
FLASHCARD QUESTION
Front
What would this program print?
def mystery(num, pattern):
result = ""
for i in range(num):
result = result + pattern
return result
print(mystery(3, "<>"))
Back
<> <> <>
6.
FLASHCARD QUESTION
Front
Which of the following options is NOT a valid Python function definition? # computes the surface area of a cube of side length 10 def surface_area(): return 2*(100 + 100 + 100), # computes the surface area of a rectangular prism def surface_area(length, width=10, height): return 2*(length width + width height + height * length), # computes the surface area of a rectangular prism def surface_area(length, width, height): return 2*(length width + width height + height * length), # computes the surface area of a rectangular prism def surface_area(length, width, height=10): return 2*(length width + width height + height * length)
Back
# computes the surface area of a rectangular prism def surface_area(length, width=10, height): return 2*(length width + width height + height * length)
7.
FLASHCARD QUESTION
Front
What will be printed when the program below is run?
def add_two(x):
return x + 2
def multiply_by_three(x):
return x * 3
def my_function(x):
return add_two(x) + multiply_by_three(x)
print(my_function(12))
Back
50
Access all questions and much more by creating a free account
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
12 questions
Poppy playtime flashcard
Flashcard
•
KG - University
9 questions
Semester 1 History Final
Flashcard
•
9th Grade
8 questions
Untitled Flashcards
Flashcard
•
10th Grade
4 questions
Haas Lathe G & M Code
Flashcard
•
12th Grade
11 questions
Movies
Flashcard
•
12th Grade
10 questions
Unit 1 - Vocab Practice
Flashcard
•
9th - 11th Grade
13 questions
Photography - Elements of art
Flashcard
•
10th - 12th Grade
10 questions
Exploring Types of Nouns
Flashcard
•
11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade