Python Programming Concepts Quiz

Python Programming Concepts Quiz

University

20 Qs

quiz-placeholder

Similar activities

POST-TEST

POST-TEST

University

15 Qs

Kelas 7 - Halaman 12 (UH Bab 1)

Kelas 7 - Halaman 12 (UH Bab 1)

7th Grade - University

15 Qs

PENCEGAHAN DAN PENANGANAN MALWARE

PENCEGAHAN DAN PENANGANAN MALWARE

9th Grade - University

20 Qs

Recap Handout 3 & 4

Recap Handout 3 & 4

6th Grade - University

15 Qs

Kuis Ms Word 1

Kuis Ms Word 1

7th Grade - University

20 Qs

Quiz #2

Quiz #2

University

15 Qs

Table,Image formatting

Table,Image formatting

5th Grade - University

15 Qs

Fundamentos de Bases de Datos

Fundamentos de Bases de Datos

10th Grade - University

15 Qs

Python Programming Concepts Quiz

Python Programming Concepts Quiz

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Medium

Created by

Abhishek Swami

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? def greet(): print("Hello") greet() greet()

Hello

HelloHello

Hello Hello

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an advantage of modular programming?

Slower execution

Easier debugging

Harder to maintain

Code repetition

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a module in Python?

A comment

A variable

A file containing Python code

A type of loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable declared inside a function?

Global

Class

Local

Module

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

local

global

scope

def

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output? x = 5 def update(): x = 10 update() print(x)

10

5

Error

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to modify a global variable inside a function without declaring it as global?

It modifies the global variable

It throws an error

It creates a new local variable

The function won't execute

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?