Python Practical Assignment
1. Write a Python program to check whether a number is divisible by 9 or 12.
2. Convert the first letter of each word in a string to uppercase.
3. Use a string method to swap uppercase to lowercase and vice versa.
4. Write a program to find the longest word in a sentence.
5. Print this pattern
1
23
456
78910
6. Find the sum of numbers from 1 to 10
7. Write a program to separate positive and negative numbers in a list.
8. Write a program to read n elements into a list and display the list.
9. Write a program to check if a list is empty using len().
10. Use min() and max() to find the smallest and largest elements in a list.
11. Write a program to copy a list using copy() and explain shallow copy.
12. Use min() and max() to find the smallest and largest elements in a list.
13. Write a function to print numbers from 1 to N.
14. Write a function to calculate factorial of a number using a while loop.
15. Write a recursive function to calculate the sum of first n natural numbers.
16. Write a Python program using recursion to generate Fibonacci series up to n terms.
17. Write a Python program that imports the random module and generates a random
number between 1 and 50.
18. Create a module with a function to check whether a number is prime, and import that
module in another Python file to test different numbers.
19. Create a package geometry with modules for:
circle area
rectangle area
Use them in a main program.
20. Create a class Bank Account with constructor to initialize balance and methods to
deposit and withdraw.