module 4 fns stk queue Python Programming Quiz

module 4 fns stk queue Python Programming Quiz

University

50 Qs

quiz-placeholder

Similar activities

Electronics

Electronics

10th Grade - University

50 Qs

2ND DIAGNOSTIC TEST

2ND DIAGNOSTIC TEST

9th Grade - University

51 Qs

Simulado_Python_ADS

Simulado_Python_ADS

University

52 Qs

Amazon AWS CLF-C01 Chapter 3 - 4

Amazon AWS CLF-C01 Chapter 3 - 4

University

49 Qs

P1 INTRO TO COMP 1-6

P1 INTRO TO COMP 1-6

University

51 Qs

M1 -  Nuevas Tecnologías de Programación

M1 - Nuevas Tecnologías de Programación

University

50 Qs

Python and C Programming Quiz

Python and C Programming Quiz

University

50 Qs

module 4 fns stk queue Python Programming Quiz

module 4 fns stk queue Python Programming Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Vigneshwari S

FREE Resource

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a global variable in Python?

Defined inside a function

Defined outside all functions

Defined only in __main__

Must be declared using global

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be printed? x = 10 def show(): x = 5 print(x) show() print(x)

5 and 5

10 and 10

5 and 10

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to modify a global variable inside a function?

nonlocal

this

global

public

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which scope rule does Python follow for name resolution?

LIFO

LEGB

FIFO

OOP

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a variable is declared inside a function without global, it is:

Local

Global

Class variable

Static

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output? x = 100 def f(): global x x = 50 f() print(x)

100

50

Error

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does nonlocal keyword do?

Declares variable global

Declares variable local

Refers to enclosing function variable

Deletes a variable

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?