4/9/2024 - Python functions

4/9/2024 - Python functions

Professional Development

7 Qs

quiz-placeholder

Similar activities

Python Basics - First step of Baby python

Python Basics - First step of Baby python

Professional Development

10 Qs

Post test data science day 24

Post test data science day 24

Professional Development

10 Qs

Python-1

Python-1

Professional Development

11 Qs

Week 1 Quiz - Python Basics

Week 1 Quiz - Python Basics

Professional Development

12 Qs

Day-2 IOAC - ML  Python Assessment_5th-Feb-2023

Day-2 IOAC - ML Python Assessment_5th-Feb-2023

Professional Development

10 Qs

Study Jam Quiz - Python

Study Jam Quiz - Python

12th Grade - Professional Development

10 Qs

IOAC - ML Batch Pre-Assessment -4th-Feb

IOAC - ML Batch Pre-Assessment -4th-Feb

Professional Development

10 Qs

Python Test 5A

Python Test 5A

Professional Development

10 Qs

4/9/2024 - Python functions

4/9/2024 - Python functions

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

Dr.S.Vidhya KGCAS

Used 4+ times

FREE Resource

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