What is the main difference between a function and a procedure?
PPL (Quiz 5) Procedures and Functions

Quiz
•
Information Technology (IT)
•
University
•
Easy
M'Alou Gonzales
Used 13+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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 Quizizz
20 questions
ICT G 7 Chapter 2.1 Input and Output Devices

Quiz
•
7th Grade - University
25 questions
IT Concepts 3

Quiz
•
12th Grade - University
25 questions
Pyhton Debugging Questions

Quiz
•
University
20 questions
Data Structures and Algorithm Lesson 1

Quiz
•
University
30 questions
PPL (QUIZ 4) Programming Control Structures

Quiz
•
University
30 questions
Week 7-8

Quiz
•
University
20 questions
Algoritmos Funciones y Procedimientos (FPRO)

Quiz
•
University
20 questions
Mastering Algorithmic Challenges

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade