Python Variables and Scope

Python Variables and Scope

12th Grade

9 Qs

quiz-placeholder

Similar activities

Python variables and Data types

Python variables and Data types

10th - 12th Grade

10 Qs

7. PYTHON FUNCTIONS -2

7. PYTHON FUNCTIONS -2

12th Grade

10 Qs

Python: Variables

Python: Variables

9th - 12th Grade

11 Qs

Python Programming Concepts Challenge

Python Programming Concepts Challenge

10th Grade - University

10 Qs

2.2.1 Variables and Functions

2.2.1 Variables and Functions

12th Grade

10 Qs

Python Basics and Syntax

Python Basics and Syntax

6th - 12th Grade

14 Qs

A5 IB -  Variables y Constantes en Python

A5 IB - Variables y Constantes en Python

10th Grade - University

10 Qs

functions arguments reference coding

functions arguments reference coding

7th - 12th Grade

11 Qs

Python Variables and Scope

Python Variables and Scope

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Amy Austin

Used 1+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are variables that are created outside of a function known as?

Local variables

External variables

Global variables

Internal variables

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Where can global variables be used?

Only inside functions

Only outside functions

Both inside and outside of functions

Nowhere

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a variable with the same name is created inside a function, what is the scope of this variable?

Global

Local

External

Universal

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to the global variable when a local variable with the same name is used inside a function?

The global variable is overwritten

The global variable is deleted

The global variable remains unchanged

The global variable becomes local

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used in Python to refer to a global variable inside a function if you want to change its value?

local

var

global

nonlocal

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the print statement in the provided Python code example?

Python is awesome

Python is fantastic

Python is x

Python is

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a type of certificate offered by the website shown in the image?

HTML Certificate

CSS Certificate

C Certificate

JavaScript Certificate

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of examples does the website provide as part of its learning material?

HTML Examples

Cooking Recipes

Travel Guides

Fashion Tips

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not listed as a reference material on the website?

Python Reference

W3.CSS Reference

Bootstrap Reference

Cooking Reference