0% found this document useful (0 votes)
17 views2 pages

Exp-5 Python Functions

Uploaded by

omkar sawant
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
17 views2 pages

Exp-5 Python Functions

Uploaded by

omkar sawant
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

EXPT NO 05

Title: Python functions


Aim: To implement a program using Python functions.
Objective: Functions help break our program into smaller and modular chunks. As our program
grows larger and larger, functions make it more organized and manageable. Furthermore, it
avoids repetition and makes the code reusable.

Theory:-
Contents covered:

1. Arguments
2. Recursion
3. Anonymous function
4. Global, local and non local
5. Global keyword
6. Modules

7. Package

https://www.javatpoint.com/python-functions

Conclusion:-Write the crux of the experiment. Here crux means very important point,
complicated and again it should be understandable by you. Do not write conclusion like thus we
have studied the ……….. in C programming.

Problem Statement:

Implement following Program:

1. Write a Python function to find the Max of three numbers.

2. Write a Python function to sum all the numbers in a list. Sample List : (8, 2, 3, 0, 7)
Expected Output : 20

3. Write a Python function to multiply all the numbers in a list. Sample List : (8, 2, 3, -1, 7)
Expected Output : -336
4. Write a Python program to reverse a string. 

5. Write a Python function to calculate the factorial of a number (a non-negative integer).


The function accepts the number as an argument.

6. Write a Python function to check whether a number is in a given range.

7. Write a Python function that accepts a string and calculate the number of upper case
letters and lower case letters. 
Sample String : 'The quick Fire Fox'
Expected Output :
No. of Upper case characters : 3
No. of Lower case Characters : 12

8. Write a Python function that takes a list and returns a new list with unique elements of the
first list. Sample List : [1,2,3,3,3,3,4,5]
Unique List : [1, 2, 3, 4, 5]

9. Write a Python program to print the even numbers from a given list.
Sample List : [1, 2, 3, 4, 5, 6, 7, 8, 9]
Expected Result : [2, 4, 6, 8]

10. Write a Python program to detect the number of local variables declared in a function.

You might also like