
python functions

Quiz
•
Computers
•
University
•
Medium
Geeta Gupta
Used 5+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code output?
11, 9
16, 16
None, None
225, 117
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct code to define a function?
def area ( ):
area ( )
def area:
def area ( )
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword marks a spot in a function where the program flow will go back to the calling code?
break
return
continue
jump
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many return statements can you place inside one function body?
As many as needed; each marks a spot where program flow returns to the calling code
You can have one return statement per parameter that is defined by the function "def"
You are limited by the number of body statements, divided by 2
Exactly one
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What controls a variable's scope?
The location where it is first initialized within your code
The comment you place to the right of the variable name
The capitalization you select for the letters in your function name
The length of your variable name
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following rules is true about locally scoped variables?
Local variables can hold less data than global variables
Local variables can be seen and accessed from any part of the program code
Local variables will keep their same value over repeated calls to the function
Local variables can only be seen and used from inside a function
Create a free account and access millions of resources
Similar Resources on Wayground
17 questions
Revision 2 C

Quiz
•
University
10 questions
Python Programming Quiz

Quiz
•
University
12 questions
R variable Data Type and Flow Control Quiz

Quiz
•
University
10 questions
Functions in Python

Quiz
•
University
15 questions
PROGRAMMING IN PYTHON - UNIT II - TEST 2 - MCQS

Quiz
•
University
15 questions
Python-loops, branches, functions

Quiz
•
University
10 questions
Variables and Constants

Quiz
•
11th Grade - University
10 questions
Python - Functions

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University