4/9/2024 - Python functions

4/9/2024 - Python functions

Professional Development

7 Qs

quiz-placeholder

Similar activities

Labour and Fetal Asphyxia

Labour and Fetal Asphyxia

Professional Development

10 Qs

IBEX A-ISB

IBEX A-ISB

Professional Development

10 Qs

MS402 - Platoon Leadership

MS402 - Platoon Leadership

Professional Development

11 Qs

Social Media & Education

Social Media & Education

Professional Development

10 Qs

PKN dan IPS PPPK

PKN dan IPS PPPK

Professional Development

10 Qs

ASD Quiz - Ask the  Therapist MY

ASD Quiz - Ask the Therapist MY

Professional Development

10 Qs

TalentNext Test Day-13-Core Java Topics

TalentNext Test Day-13-Core Java Topics

Professional Development

10 Qs

Operate Scissor Lift

Operate Scissor Lift

Professional Development

10 Qs

4/9/2024 - Python functions

4/9/2024 - Python functions

Assessment

Quiz

Professional Development

Professional Development

Practice Problem

Hard

Created by

Dr.S.Vidhya KGCAS

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

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

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following function call

def fun1(name, age=20):

print(name, age)

fun1('X', 25)

X 25

X 20

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Python function always returns a value

True

False

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'def' keyword in Python?

It indicates the start of a loop

It defines a new variable

It defines a new function

It imports a module

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a default parameter value in a Python function?

A value that is optional when calling the function

The first value passed to the function

A constant value in a function

A value that is used if no argument is provided

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

def sum(a, b=2):

return a + b

print(sum(3))

Error

3

2

5

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following function definition mean?

def multiply(x, y=1):

return x * y

The function requires two arguments

The function will only multiply x

y is an optional parameter with a default value of 1

The function will not work without specifying y

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Functions already defined in python is

User defined function

Built-in functions

Library functions

Both b and c

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?

Discover more resources for Professional Development