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
Create a free account and access millions of resources
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
13 questions
Judaism and Its Foundational Concepts
Flashcard
•
12th Grade
10 questions
DENR-CAR Environmental Flashcard (INTERMEDIATE ROUND)
Flashcard
•
KG
11 questions
Sewing Machine Components and Functions
Flashcard
•
10th Grade
8 questions
French and Indian War
Flashcard
•
10th Grade - University
10 questions
G9 T1 End of Term Review
Flashcard
•
9th - 12th Grade
10 questions
EXCEL 2019 BEGINNERS 1
Flashcard
•
9th - 12th Grade
5 questions
Cvc word game
Flashcard
•
KG - University
11 questions
Untitled Flashcards
Flashcard
•
KG - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
20 questions
christmas songs
Quiz
•
KG - University