Exercise Programs
1. Write a Python program to perform arithmetic operations on two numbers:
a) Addition
b) Subtraction
c) Multiplication
d) Division
e) Modulus
2. Write a Python program that takes a string as input from the user and performs the
following operation:
a) Display the original string.
b) Find and display the total length of the string.
c) Print the first 5 characters.
d) Print the last 5 characters.
e) Print characters from index 3 to 8.
f) Display the string in reverse
3. Write a Python program to perform the following operations on a list:
a) Create an empty list.
b) Add values to the list using all three methods
c) Display the list after adding the values.
d) Remove values from the list using all three methods
e) Display the list after removing the values
4. Write a Python program to perform the following operations on a tuple:
a) Create a tuple with at least 5 elements.
b) Display all the values of the tuple.
c) Find and display the length of the tuple.
d) Find and display the data type of the tuple
5. Write a Python program to perform the following operations on a dictionary:
a) Create a dictionary with initial values.
b) Add new key-value pairs.
c) Update the value of an existing key.
d) Delete a key from the dictionary.
e) Display the dictionary after each operation.