PYTHON-06

PYTHON-06

9th - 12th Grade

•

30 Qs

quiz-placeholder

Similar activities

Tercer Quizz ... vos podés

Tercer Quizz ... vos podés

12th Grade

•

25 Qs

Plagiarism

Plagiarism

7th - 10th Grade

•

25 Qs

Briana Review

Briana Review

12th Grade

•

25 Qs

Revision hardware, Input,Output,Main Memory, Storage, Processing

Revision hardware, Input,Output,Main Memory, Storage, Processing

11th Grade

•

25 Qs

kuis TKJ

kuis TKJ

10th Grade

•

25 Qs

Storage Hardware and Software

Storage Hardware and Software

9th - 10th Grade

•

25 Qs

Network Threat Prevention 2

Network Threat Prevention 2

8th - 10th Grade

•

25 Qs

La Tour Eiffel

La Tour Eiffel

5th - 10th Grade

•

25 Qs

PYTHON-06

PYTHON-06

Assessment

Quiz

•

Computers

•

9th - 12th Grade

•

Practice Problem

•

Medium

Created by

Riya Shakya

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

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

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is a global variable in Python?

A variable that is accessible only within a specific function.

A variable that is accessible from anywhere in the program.

A variable that is defined within a class.

A variable that is defined within a loop.

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

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

local

global_word

non_local

global

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What happens if a global variable shares the same name as a local variable within a function?

The local variable takes precedence over the global variable.

The global variable takes precedence over the local variable.

An error occurs due to naming conflict.

Both variables are combined into a single variable.

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Where are global variables typically defined in a Python program?

Inside a function

Inside a loop

At the top level of the program

Inside a class

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is the scope of a global variable?

Limited to the function in which it is defined

Limited to the block in which it is defined

Limited to the class in which it is defined

Accessible from anywhere in the program

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following is an example of a local variable?

x = 5

PI = 3.14

name = "John"

count = 0

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Can a local variable be accessed from outside the function in which it is defined?

yes

no

Access all questions and much more by creating a free account

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

Already have an account?