0% found this document useful (0 votes)
5 views1 page

Python Programming Exercise Guide

The document outlines a series of Python programming exercises focused on basic operations. It includes tasks for arithmetic operations, string manipulations, list and tuple operations, and dictionary management. Each exercise specifies the required actions to be performed, such as displaying values and modifying data structures.

Uploaded by

25495
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Python Programming Exercise Guide

The document outlines a series of Python programming exercises focused on basic operations. It includes tasks for arithmetic operations, string manipulations, list and tuple operations, and dictionary management. Each exercise specifies the required actions to be performed, such as displaying values and modifying data structures.

Uploaded by

25495
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like