Search Header Logo

Python Scope

Authored by Amy Austin

Other

12th Grade

Used 3+ times

Python Scope
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable created inside a function in Python?

Local scope

Global scope

External scope

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can a variable outside of a function be accessed within the function in Python?

By importing it

By passing it as an argument

By declaring it as external

By declaring it as global

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to modify a global variable inside a function?

modify

public

extern

global

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a Python data type?

Variable

Python

List

Function

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method is used to add an item to a list in Python?

append()

add()

push()

insert()

6.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following is used to start a loop in Python?

for

loop

repeat

while

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to comment a single line in Python?

// This is a comment

# This is a comment

/* This is a comment */

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?