Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Course : Diploma in Information Technology

Module Code : Unit_08


Module : Programming in Python
A practical is an opportunity for students to test and apply their understanding of the
concepts and ideas introduced in lectures. "Practicals" are called this because they are the
place where the "theoretical" knowledge gained in lectures and readings is put into practice.

Practical (4 Hours)

1. Use Python IDLE to find the outputs to the following.


a) 2**3+4+9-7%2
b) 65//8*6+45
c) 5**2+9-4
d) 25//5-4+36
e) 92+4*5//2

2. Write a Python program to enter 5 numbers and print the average.

3. Write a Python program to input the marks of 3 subjects. Then Calculate and print the total
and the average of the marks.

4. Re-write the program in question 3 to get the name of the student and the marks as user
inputs.

5. Write a program to find the circumference of a circle.

6. Write a program to get the length and width of a rectangle as user inputs and display the
perimeter.

7. Write a Python program to find the volume of a sphere.

8. A) Write a Python program to enter the radius of a circle and calculate the area of the circle.
B) Re-write the program to get the radius as a user input.

Page 1
9. Create a program that asks the user to enter their name and their age. Print out a message
addressed to them that tells them the year that they will turn 100 years old.

10. A) Write a Python program to create a string variable to store a value “Welcome to Python
Programming Language”.

B) Write the print statements to get the following outputs.


i. Python Programming
ii. W
iii. u
iv. Welcome to Python

11. Write a Python program to get the user to input the first name and last name separately and
print the entire name as a single output.

12. A) Create a dictionary to store the id, name, age, marks and grade of a student.
B) Write the code to display the id, name and average of the student.

13. A) Create a list to store 5 fruits.


B) Write the code to display
i) the first three items on the list.
ii) first item
iii) last 2 items
C) Repeat the code for a tuple

14. Create a list of fruits and print your favorite food


Ex:- fruits = [“Apple”, “Orange”, “Mango”, “Pineapple”]

My favorite fruit is Apple

15. Create a dictionary to store your exam marks for five subjects as key value pairs and print
one by one.

Page 2

You might also like