Quiz on Modularity and Functions

Quiz on Modularity and Functions

University

20 Qs

quiz-placeholder

Similar activities

Mastering Python Control Flow

Mastering Python Control Flow

University

15 Qs

DSA (QUIZ 3) - Recursion

DSA (QUIZ 3) - Recursion

University

15 Qs

Codean - Java Rekursi

Codean - Java Rekursi

University

18 Qs

Seatwork #4

Seatwork #4

12th Grade - University

25 Qs

Selection Programming_If condition

Selection Programming_If condition

8th Grade - University

15 Qs

Pretest 5 - PBW 2B - PHP

Pretest 5 - PBW 2B - PHP

University

20 Qs

Python_MCQ_2

Python_MCQ_2

University

15 Qs

2F-3 | Python Quiz | 22/11/2024

2F-3 | Python Quiz | 22/11/2024

University

20 Qs

Quiz on Modularity and Functions

Quiz on Modularity and Functions

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Abhishek Swami

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is one main advantage of modular programming?

Increases execution time

Reduces the number of functions

Avoids use of loops

Makes code reusable and easier to debug

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a disadvantage of modularity?

Difficult to maintain

Slows down debugging

Increased memory overhead due to function calls

Code readability decreases

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

Hello

HelloHello

Hello\nHello

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, a variable declared inside a function is:

Always global

Local by default

Static

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

10 10

5 10

5 5

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to access a global variable inside a function?

local

nonlocal

global

var

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this code?

10

20

Error

0

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?