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

Python Scope

Quiz
•
Other
•
12th Grade
•
Hard
Amy Austin
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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 */
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Vocabulario, vocabularies, vocabulaires

Quiz
•
5th - 12th Grade
10 questions
C Language Basic Quiz

Quiz
•
7th Grade - Professio...
12 questions
Intro to Python Programming Quiz 9C

Quiz
•
10th Grade - University
14 questions
Intro to Python Programming Quiz 9B

Quiz
•
10th Grade - University
10 questions
Introductory Quiz

Quiz
•
9th - 12th Grade
10 questions
Python - Conceptos teóricos

Quiz
•
12th Grade
10 questions
Research-Chapter 1

Quiz
•
12th Grade
13 questions
Python Fundamentals and Programming

Quiz
•
11th - 12th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade