100% found this document useful (1 vote)
4 views1 page

Module2 Assignment

This assignment requires students to complete various tasks related to functions and strings in Python, including defining functions, explaining function arguments, and writing specific programs. Students must follow strict submission guidelines, including handwritten work on A4 sheets and a due date of November 21, 2025. The tasks include writing programs for finding the largest number, checking vowels, computing factorials, and more.

Uploaded by

rkr2122raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
4 views1 page

Module2 Assignment

This assignment requires students to complete various tasks related to functions and strings in Python, including defining functions, explaining function arguments, and writing specific programs. Students must follow strict submission guidelines, including handwritten work on A4 sheets and a due date of November 21, 2025. The tasks include writing programs for finding the largest number, checking vowels, computing factorials, and more.

Uploaded by

rkr2122raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MODULE–2 (Functions & Strings)

ASSIGNMENT 2

Please follow the instructions below carefully while completing this assignment:
1. Use A4 sheets for the assignment.
2. The assignment should be handwritten. Typed submissions will not be accepted.
3. Write the code neatly with proper indentation. Code structure is essential for readability and
understanding.
4. Compile all A4 sheets in order and number each page at the top right corner.
5. Submit the sheets stapled. Failure to adhere to these instructions may affect your grade
6. Due Date: Friday, November 21, 2025. Late submissions will not be accepted.

1. Define a function in Python. Write down the advantages of using functions in Python.

2. Explain the different types of function arguments with examples.

3. What are actual and formal parameters? Explain different types of return statements in Python with
examples.

4. What are nested functions? Write a program that contains a function inside another function.

5. Write a python program using functions that returns the largest of three numbers.

6. Write a python program using functions to check if a character is a vowel.

7. Write a python program to compute factorial(n) using recursion.

8. Write a Python program to find the smallest of two numbers using a lambda function.

9. Write a python program using functions that returns the number of vowels in a string.

10. Write a python program using functions to check whether a given word is a palindrome.

11. Write a Python program to demonstrate string slicing using positive indices, negative indices and step
values.

12. Write a Python program to demonstrate built-in string methods with examples.

13. Write a Python program that counts alphabets, digits, spaces and special characters in a string.

14. Develop a program that encrypts a message by adding a key value to every character.

Hint: If key=3 then the string “HelloWorld” encrypted as “KhoorZruog”

15. Develop a program that takes username and PAN number as input, validate the information using
isXfunction and print the details.

You might also like