Global and local variables

Global and local variables

10th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Pensamiento computacional

Pensamiento computacional

9th - 12th Grade

10 Qs

Know thy Peer-to-Peer

Know thy Peer-to-Peer

12th Grade

10 Qs

Internet

Internet

10th Grade

12 Qs

Programacion Orientada a Objetos

Programacion Orientada a Objetos

12th Grade - University

10 Qs

Networks - Introduction

Networks - Introduction

10th Grade

13 Qs

Micro:Bit Quiz Unidad 3

Micro:Bit Quiz Unidad 3

10th Grade

10 Qs

lets test!!

lets test!!

8th - 10th Grade

12 Qs

Desarrollo de Aplicaciones Web - Día 3

Desarrollo de Aplicaciones Web - Día 3

10th Grade

10 Qs

Global and local variables

Global and local variables

Assessment

Quiz

Computers

10th - 12th Grade

Practice Problem

Medium

Created by

Louise Lockwood

Used 416+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A variable declared within a subroutine

Global

Local

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A variable declared in the main program

Global

Local

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The correct way to write a variable in Python?

myVariable = 10
my Variable = 10
myVariable is 10
myVariable: 10

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an advantage of using local variables?

They allow the variable to be used throughout the whole program

They allow variable identifiers to be reused each time

They are easier to program than global variables

A wider range of data types can be used

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What term is used to describe data passed into/out of a program?

Variable

Loop

Constant

Parameter

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Leo wants to create a subroutine that will roll a dice. Which syntax is correct?

def dice roll ():

def diceroll ()

def diceroll ():

def diceroll []:

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Which is the correct output for this program?

bacon local ,spam local, bacon local, global

spam local, bacon local, bacon local, global

global, bacon local, spam local, bacon local,

global, spam local, bacon local, bacon local

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?