Truba Institute of Engineering & Information Technology
Karond Gandhi Nagar by Pass Road, Bhopal – 462038 (M.P) Tel: 2734691-92-93 Fax: 2734694
Office: 215, Zone-I, M.P. Nagar, Bhopal-462011. Tel.:4220040, 3013222
E-Mail:[email protected] Visit us at www.trubainstitute.ac.in
SUBJECT CODE – CS406
PYTHON
Prepared By :-
Assistant Professor
Sajal Agrawal
Truba Institute of Engineering & Information Technology Prepared By – Sajal Agrawal
Page 1
Python
🔹 Basic Programs: (Any 2)
1. Write a program to check whether a number is even or odd.
2. Write a program to find the largest of three numbers using if-else.
3. Write a program to swap two numbers without using a third variable.
🔹 Loops & Iteration: (Any 2)
4. Write a program to print the Fibonacci series up to n terms.
5. Write a program to check whether a number is prime.
6. Write a program to print the multiplication table of a number.
7. Write a program to print the factorial of a number using a loop.
🔹 Functions: (Any 2)
8. Write a function to check whether a number is a palindrome.
9. Write a function to check whether a string is a palindrome.
10. Write a function to calculate the sum of digits of a number.
11. Write a function to count vowels in a given string.
🔹 Strings: (Any 1)
12. Write a program to reverse a string using a loop.
13. Write a program to check if a string is a pangram (contains all letters A-Z).
14. Write a program to count words and characters in a string.
🔹 Lists and Tuples: (Any 1)
15. Write a program to find the largest element in a list.
16. Write a program to remove duplicates from a list.
17. Write a program to sort a list in ascending and descending order.
🔹 Dictionaries: (Any 1)
18. Create a dictionary of students and marks, and display:
Highest mark
Average mark
Truba Institute of Engineering & Information Technology Prepared By – Sajal Agrawal
Page 2
🔹 Conceptual: (Important Question)
19. Explain all concepts of OOPs with example.
Truba Institute of Engineering & Information Technology Prepared By – Sajal Agrawal
Page 3