Menu

Global & Local Variables - Code Quiz

1. The program prints two values. Which pair shows the two values printed, in order?

def changeNum(): num = 6 print(num) num = 5 changeNum() print(num)
5, 6
6, 6
5, 5
6, 5

2. What is printed by the program?

def setPoints(): points = 20 points = points + 5 points = 10 setPoints() print(points)
15
35
25
10

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic