PPL (Quiz 5)  Procedures and Functions

PPL (Quiz 5) Procedures and Functions

University

25 Qs

quiz-placeholder

Similar activities

Quiz KTI

Quiz KTI

University

20 Qs

Emerging Technologies

Emerging Technologies

University

20 Qs

Programación y robótica - A

Programación y robótica - A

7th Grade - University

20 Qs

Mock-Up Academy Programming Online Test

Mock-Up Academy Programming Online Test

6th Grade - University

20 Qs

Google Sheets Quiz - 17/09/2024

Google Sheets Quiz - 17/09/2024

University

20 Qs

2D-2 | Google Sheets Quiz | 09.12.2024

2D-2 | Google Sheets Quiz | 09.12.2024

University

20 Qs

Quiz 1 | Information Security | Kali Linux Commands

Quiz 1 | Information Security | Kali Linux Commands

University

20 Qs

Sumatif Bab 1 (Informatika & Kemampuan Umum")

Sumatif Bab 1 (Informatika & Kemampuan Umum")

10th Grade - University

20 Qs

PPL (Quiz 5)  Procedures and Functions

PPL (Quiz 5) Procedures and Functions

Assessment

Quiz

Information Technology (IT)

University

Easy

Created by

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

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?