Python Functions and Exceptions Review

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Wayground Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Which of the following is the correct way to declare a function in Python? Options: print_hello: print("hello"), function print_hello(): print ("hello"), print_hello(): print("hello"), def print_hello(): print("hello").
Back
def print_hello(): print("hello")
2.
FLASHCARD QUESTION
Front
Which of the following code samples correctly passes the number 10 as an argument to the function print_number? Options: print_number(10), print_number() print 10, 10(print_number), print print_number print 10
Back
print_number(10)
3.
FLASHCARD QUESTION
Front
Consider this code snippet. Which of the following additional functions could be safely added below this code, without causing an error?
Back
4.
FLASHCARD QUESTION
Front
Which of the following functions successfully returns the number 10?
Back
5.
FLASHCARD QUESTION
Front
What type of error occurs when a program is expecting an integer value and the user enters a string?
Back
ValueError
6.
FLASHCARD QUESTION
Front
Why do programmers use try and except statements when their code might throw an exception?
Back
To handle exceptions gracefully and either handle the error or print out a useful error message.
7.
FLASHCARD QUESTION
Front
Which of the programs below will print the following output?
I would like a green balloon.
Back
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Fingerprint Classification

Flashcard
•
9th - 12th Grade
14 questions
PYTHON -- Variables/Inputs

Flashcard
•
9th - 12th Grade
14 questions
Print vs Web

Flashcard
•
9th - 12th Grade
12 questions
Basics Python

Flashcard
•
8th - 10th Grade
15 questions
Flashcard Review

Flashcard
•
9th Grade - University
14 questions
Python Basics & Syntax

Flashcard
•
10th - 12th Grade
10 questions
CODEHS Looping Unit 5 Review

Flashcard
•
9th - 12th Grade
9 questions
Python Review 5/23

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

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

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade