LEC Short Quiz # 2

LEC Short Quiz # 2

University

30 Qs

quiz-placeholder

Similar activities

ARDUINO BOARD

ARDUINO BOARD

10th Grade - University

35 Qs

Go-Quizzy

Go-Quizzy

University

30 Qs

C# Skill Review

C# Skill Review

12th Grade - Professional Development

32 Qs

estudiando python

estudiando python

University

31 Qs

Arduino Aptitude

Arduino Aptitude

University

30 Qs

Advanced PLC

Advanced PLC

University

25 Qs

REVIEW FOR PMS

REVIEW FOR PMS

University

25 Qs

construction management day -2

construction management day -2

University

25 Qs

LEC Short Quiz # 2

LEC Short Quiz # 2

Assessment

Quiz

Other

University

Easy

Created by

Dindo Cerado

Used 8+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a global variable in Python?

A variable set inside a function

A variable declared outside all functions

A variable removed after function ends

A variable used only in one function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to a local variable after the function ends?

It stays accessible to all

It is removed and not reused

It turns into a global variable

It is kept for later access

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword allows you to change a global variable from inside a function?

local

global

lambda

function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What best describes a lambda function in Python?

A function with more than one line

A tiny anonymous one-line function

A function that sets global values

A regular function using lambda

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following shows the lambda function syntax?

lambda args: output

def name(args): output

function(args): result

lambda output: args

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is a lambda function different from a normal function?

Lambda allows multiple lines

Named functions are anonymous

Lambda is one-line and unnamed

Regular functions can't use input

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why are functions used in Python?

To increase code length

To simplify and reuse code

To make code more complex

To store global variables

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?