Global and local variables

Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Louise Lockwood
Used 350+ times
FREE Resource
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
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
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
Similar Resources on Wayground
10 questions
7. PYTHON FUNCTIONS -2

Quiz
•
12th Grade
10 questions
2.2.1 Variables and Functions

Quiz
•
12th Grade
14 questions
Quarter 1 PLTW CSE Exam Review

Quiz
•
10th Grade
10 questions
Functions and Parameters Summative preview

Quiz
•
9th - 12th Grade
15 questions
09-Subroutines-GCSE-Python

Quiz
•
11th Grade
15 questions
Subroutine

Quiz
•
10th Grade
14 questions
GCSE Computing - Subprograms

Quiz
•
9th - 10th Grade
10 questions
Subprograms

Quiz
•
11th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
10 questions
Essential Lab Safety Practices

Interactive video
•
6th - 10th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade