LEC Short Quiz # 2

LEC Short Quiz # 2

University

30 Qs

quiz-placeholder

Similar activities

Linux Сессия

Linux Сессия

University

25 Qs

Acción Esencial #3

Acción Esencial #3

University

25 Qs

PARCIAL 1 PROC. TEC. ADM.

PARCIAL 1 PROC. TEC. ADM.

University

25 Qs

Star Wars  1-9

Star Wars 1-9

KG - University

25 Qs

primo test

primo test

6th Grade - University

25 Qs

UAS MyOB

UAS MyOB

University

25 Qs

REPUBLIC DAY QUIZ COMPETITION, JAN 2022 - PRELIMS

REPUBLIC DAY QUIZ COMPETITION, JAN 2022 - PRELIMS

University

25 Qs

SAS MATEMATIKA Kelas V

SAS MATEMATIKA Kelas V

5th Grade - University

25 Qs

LEC Short Quiz # 2

LEC Short Quiz # 2

Assessment

Quiz

Other

University

Practice Problem

Easy

Created by

Dindo Cerado

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?