Python Functions and Exceptions Review

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz 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
14 questions
Python Basics & Syntax

Flashcard
•
10th - 12th Grade
11 questions
AP CSP Vocab Flashcard BI 1, 2

Flashcard
•
9th - 12th Grade
10 questions
Paper Practice 2

Flashcard
•
9th - 12th Grade
13 questions
Functions and Parameters

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

Flashcard
•
9th - 12th Grade
8 questions
Code.org Unit 3 Review

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

Flashcard
•
9th - 12th Grade
14 questions
Javascript Control Structures Practice

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
Discover more resources for Computers
50 questions
Trivia 7/25

Quiz
•
12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade
6 questions
RL.10.1 Cite Evidence

Quiz
•
10th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
14 questions
Algebra 1 SOL Review #1

Quiz
•
9th Grade