Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Programming in Python - - Unit 9 - Week 9 (Contents)_ Python Functions

The document outlines the content and assessment details for a Programming in Python course, specifically focusing on functions. It includes scores for various assignments and quizzes, along with questions related to Python functions, parameters, and lambda functions. The document also indicates that the assignment submission deadline has passed and provides a link for further course exploration.

Uploaded by

rvseceprint
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Programming in Python - - Unit 9 - Week 9 (Contents)_ Python Functions

The document outlines the content and assessment details for a Programming in Python course, specifically focusing on functions. It includes scores for various assignments and quizzes, along with questions related to Python functions, parameters, and lambda functions. The document also indicates that the assignment submission deadline has passed and provides a link for further course exploration.

Uploaded by

rvseceprint
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

4/23/24, 3:17 AM Programming in Python - - Unit 9 - Week 9 (Contents): Python Functions

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/CEC)

mathavi.2007@gmail.com 

CEC (https://swayam.gov.in/explorer?ncCode=CEC) » Programming in Python (course)

Course Assessment-9-2024
outline The due date for submitting this assignment has passed.
Due on 2024-04-20, 23:59 IST.
Week 1 Score: 9/10=90%
(Contents) :
Planning the
Computer Assignment submitted on 2024-04-14, 20:41 IST
Program () 1) Which of the following is a built-in function in Python? 1 point

Week 2 def
(Contents): lambda
Techniques
return
of Problem
Solving () yield

No, the answer is incorrect.


Week 3 Score: 0
(Contents): Accepted Answers:
Introduction lambda
to Python ()
2) Which of the following statements is true about functions in Python? 1 point
Week 4
(Contents): Functions cannot return any value.
Conditional Functions in Python must be defined using the function keyword.
Statements Functions in Python can take arguments and return values.
and Looping
Functions in Python cannot call other functions.
()
Yes, the answer is correct.
Week 5 Score: 1
(Contents): Accepted Answers:
String Functions in Python can take arguments and return values.
Manipulation
() 3) What is the purpose of the return statement in a Python function? 1 point

To terminate the function execution.

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=50&assessment=100 1/4
4/23/24, 3:17 AM Programming in Python - - Unit 9 - Week 9 (Contents): Python Functions

Week 6 To print a value to the console.


(Contents): To define a new variable.
Introduction To return a value from the function.
to list. ()
Yes, the answer is correct.
Score: 1
Week 7 Accepted Answers:
(Content): To return a value from the function.
Introduction
to tuples. () 4) In Python, what is a parameter in a function? 1 point

A variable that holds the return value of the function.


Week 8
(Contents): A variable that holds a value passed to the function.
Introduction A variable that is defined inside the function.
to
A variable that is declared globally.
dictionaries
() Yes, the answer is correct.
Score: 1
Accepted Answers:
Week 9
A variable that holds a value passed to the function.
(Contents):
Python
Functions () 5) What is the output of the following code? 1 point
def add(x, y):
Lecture 1: return x+10, y+10
Defining and
Calling a result = add(14, 15)
function (unit? print(result)
unit=50&lesso
n=51) (24, 25)
Lecure 2: (14, 15)
Types of 49
functions,
Error
arguments and
working with Yes, the answer is correct.
global and Score: 1
local variables Accepted Answers:
(unit? (24, 25)
unit=50&lesso
n=52) 6) Which of the following is the correct way to call a function named my_function with 1 point
Lecture 3: two arguments a and b?
Working with
Functions my_function a, b
(unit? my_function(a, b)
unit=50&lesso
my_function(a b)
n=53)
my_function(a b)
Lecture
Material (unit?
Yes, the answer is correct.
Score: 1
unit=50&lesso
Accepted Answers:
n=54)
my_function(a, b)
Quiz:
Assessment- 7) What is the output of the following code? 1 point
9-2024 def outer_func(x, y):

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=50&assessment=100 2/4
4/23/24, 3:17 AM Programming in Python - - Unit 9 - Week 9 (Contents): Python Functions

(assessment? def inner_func(m, n):


name=100) return m + n

Week 10
return inner_func(x, y)
(Contents) :
return x
Python
Modules ()
result = outer_func(5, 10)
print(result)
Week 11
(Contents): 15
Input-Output
5
()
10
Week 12 50
(Contents):
Yes, the answer is correct.
Exception Score: 1
Handling () Accepted Answers:
15

8) What is the purpose of the *args parameter in a function definition? 1 point

To allow the function to accept a variable number of arguments.


To define a default value for an argument.
To allow the function to accept a keyword argument.
To define a required argument.

Yes, the answer is correct.


Score: 1
Accepted Answers:
To allow the function to accept a variable number of arguments.

9) Which of the following is the correct syntax to define a lambda function in Python? 1 point

def my_lambda(): x + 1
lambda x: x + 1
lambda(x): return x + 1
function lambda(x): return x + 1
Yes, the answer is correct.
Score: 1
Accepted Answers:
lambda x: x + 1

10) What will be the output of the following code? 1 point


def my_function(*fruits):
print(fruits[0])

my_function("Apple", "Mango", "Banana","Kiwi")

Apple
Mango
Banana
Kiwi
Y h i

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=50&assessment=100 3/4
4/23/24, 3:17 AM Programming in Python - - Unit 9 - Week 9 (Contents): Python Functions

Yes, the answer is correct.


Score: 1
Accepted Answers:
Apple
You were allowed to submit this assignment only once.

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=50&assessment=100 4/4

You might also like