Python Programs CLO1 Final
Python Programs CLO1 Final
Aim
To write a Python program to generate all prime numbers in a given interval using both for
and while loops.
Aim
To demonstrate creating a list, appending elements, and removing items using Python list
operations.
Aim
To demonstrate tuple creation, accessing elements, and checking existence using Python.
Algorithm (10 Lines)
21. 1. Start the program.
22. 2. Ask the user for tuple elements (comma-separated).
23. 3. Convert input to a tuple.
24. 4. Display the tuple.
25. 5. Ask the user to input an element to search.
26. 6. Check if the element exists in the tuple.
27. 7. If yes, print the index.
28. 8. Display the length of the tuple.
29. 9. Display slicing and count examples.
30. 10. End program.
Aim
To write a Python program to compute the factorial of a number using a recursive function.
Aim
To demonstrate creating, updating, accessing, and deleting elements in a dictionary.