0% found this document useful (0 votes)
9 views5 pages

Assign 5

This document is an assignment for a 6th semester Computer Engineering student at GOVT MODEL ENGINEERING COLLEGE, focusing on Python programming. It includes topics such as lambda functions, list comprehension, recursion, and mathematical functions. The assignment emphasizes original work, academic integrity, and includes various programming tasks to be completed using Python.

Uploaded by

foralbygames
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Assign 5

This document is an assignment for a 6th semester Computer Engineering student at GOVT MODEL ENGINEERING COLLEGE, focusing on Python programming. It includes topics such as lambda functions, list comprehension, recursion, and mathematical functions. The assignment emphasizes original work, academic integrity, and includes various programming tasks to be completed using Python.

Uploaded by

foralbygames
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

GOVT MODEL ENGINEERING COLLEGE- IHRD

DEPARTMENT OF COMPUTER ENGINEERING

Roll No: 08 Name: ALBY THEKKEDAN

Semester/Class: 6th CS B Academic Year: 202

ASSIGNMENT- 5

Course Code and Name: CST 362 Programming In Python

Due Date Date of Submission Date of Return


29 MARCH Before 10 :00 am

SI. No Topics CO Cognitive Level


mapping
1 Learn Functions

Declaration and statement of authorship

• This assignment is my original work and no part of it has been copied from any other student’s work or from
any other source except where due acknowledgment is made.
• No part of this assignment has been written for me by any other person except where such collaboration has
been authorized by the faculty concerned and must be clearly acknowledged.
• I give permission to copy the marked work to be retained in the department for NBA requirement.
• I understand plagiarism and obey the academic ethics.
• I understand that academic misconduct is a punishable offence.

Signature of the student:

COs
Addressed Total
Max
Marks
Marks
Obtained

Remarks:

Signature

Faculty: Binu VP
1. What are lambda functions?
Let f(x)=x^2+3x+5 g(x,y)=x^2y+5xy+6
Find f(2)+g(3,2) using lambda functions.
In Python, a lambda function is a small, anonymous function that can take any number of arguments, but
can only have one expression. Lambda functions are also known as anonymous functions, inline
functions or single-expression functions.

The syntax for a lambda function is as follows:


lambda arguments: expression
Here, arguments refers to the arguments passed to the function, separated by commas. The expression is
the single statement that the function executes, and its result is returned.

2. Create a List L consist of (rno,name) tuples.( include your name and


rollnumber) L=[(1,’aswith’),(3,’charles’),(2,’ ’bibit’)]
Sort and print the list in the order of rno and print the list in the order of name Use lambda
functions.

3. Use list comprehension to create a list of odd numbers less than 50.
Use lambda function and map function to find the cube of numbers stored in the list. Use
lambda function and filter function to find the numbers divisible by 3.
4. Write a function prime (n) which will return True if the number is prime or else False
Use the above function to print numbers less than 100.

5. Write a recursive function to find the factorial of a given number Use the above function
to compute nCr.

6. Write a recursive function to find the n’th Fibonacci number Use the above function to
print the Fibonacci series.
7. Use a recursive function to find the sum of the digits of a number.

8. Write a function which will take n numbers as argument and return the largest element
9. Find the binary equivalent of each digit of a number(ie;BCD each digit is represented
as 4 bit binary). Use a separate function to find binary.

10. Find the sum of the cosine series 1-x^2/2!+x^4/4!-x^6/6!..... n terms.Use a function fact to
find the factorial of the number.

You might also like