A2 A4
A2 A4
2. Write a Python script that takes input from the user and displays that input back in
upper and lower cases.
3. Write a Python program to change a given string to a new string where the first and
last chars have been exchanged.
4. Write a Python program to get the 4th element from the last element of a tuple.
5. Write a Python program to count the occurrences of each word in a given sentence.
6. Write a Python program to Check if two lists have at-least one element common
7. Write a Python program to Python program to count number of vowels using sets in
given string
8. Write a Python program to Check difference between two list
9. Write a Python program to calculate the length of a string.
10. Write a Python program to get a string from a given string where all occurrences
of its first char have been changed to '$', except the first char itself. Sample String :
'restart'
Expected Result : 'resta$t'
11. Write a Python program to remove the n th index character from a nonempty
string.
12. Write a Python program to change a given string to a new string where the first
and last chars have been exchanged.
13. Write a Python program to remove the characters which have odd index
values of a given string.
14. Write a Python program to find the index of an item in a tuple.
15. Write a Python program to find the length of a tuple.
16. Write a Python program to convert a tuple to a dictionary.
17. Write a Python program to reverse a tuple.
18. Write a Python program to find the largest among three different numbers entered by
user.
19. Write a Python program to find all the roots of a quadratic equation ax2+bx+c=0
20. Write a Python program to find the Fibonacci series till term≤1000.
21. Write a Python program to find whether given number is Prime or not
22. Write a Python program to find the first 100 prime numbers.
23. Write a Python program to find whether given number is Armstrong number or not
24. Write a Python program to find those numbers which are divisible by 7 and multiples
of 5, between 1500 and 2700 (both included).
25. Write a Python program to guess a number between 1 and 9.