PPL (Quiz 5) Procedures and Functions

Quiz
•
Information Technology (IT)
•
University
•
Easy
M'Alou Gonzales
Used 14+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main difference between a function and a procedure?
Functions return a value, while procedures do not.
Procedures return a value, while functions do not.
Functions are only used in Python, while procedures exist in all languages.
There is no difference between functions and procedures.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In which of the following scenarios is a procedure more appropriate than a function?
Calculating the total price of a shopping cart.
Checking the balance of a bank account.
Transferring money between two accounts.
Converting Celsius to Fahrenheit.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct example of a function in Python?
def greet(): print("Hello")
def add(a, b): return a + b
def display(): pass
Both A and B
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is "pass by value" in parameter passing?
The function receives a copy of the variable.
The function modifies the original variable.
The function cannot accept parameters.
The function only works with integers.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is "pass by reference" in parameter passing?
The function gets a copy of the variable.
The function modifies the original variable.
The function creates a new variable.
The function only accepts strings.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which type of variable is only accessible inside the function where it is declared?
Global variable
Local variable
Static variable
Reference variable
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of this code? x = 5 def myFunc(): x = 10 print(x) myFunc() print(x)
10 10
5 5
10 5
Error
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
quiz1B1

Quiz
•
7th Grade - University
20 questions
Eva_Est_P1_11_PMV

Quiz
•
4th Grade - University
20 questions
Python Programming Quiz

Quiz
•
University
30 questions
C-Volution (Easy 1)

Quiz
•
University
30 questions
Y9 Python Review

Quiz
•
9th Grade - University
24 questions
LAB_Quiz-2

Quiz
•
University
24 questions
BSAB1C FQuiz2

Quiz
•
University
23 questions
C++ Functions Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

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

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University