Practicals
Practicals
1. Write a program to compute simple interest and compound interest given principle,
rate and time period.
2. Write a program to convert temperature in Celsius to Fahrenheit & vice versa.
3. Write a program to find the largest of three numbers.
4. Write a program to find whether the year is a leap year or not.
5. Write a program to find the area of a triangle using Heron’s formula.
6. Write a program to generate 6 random numbers between 100 and 999 and then print their
mean, median and mode.
7. Write a program to find the roots of the quadratic equation.
8. Write a program to perform all [+,-,*,/,%,**] the mathematical operations on a set
of values.
9. Write a program to input 3 sides of a triangle and prints whether it is an equilateral,
isosceles or scale triangle.
10. Write a program to a digit and print it in words.
11. Write a program to show if the entered character is uppercase or lowercase.
12. WAP to generate the Electric Bill charges according to charges. Following are the fares:First
100 Units : 1 Rs per day.
Next 200 Units : 2 Rs per day.
Above 300 Units : 4 Rs per day.
13. Write a program to accept the cost price of a bike and display the road tax to be paidaccording to the
following criteria:
a) * b) * c) 54321
** 5432
** ** * 543
*** ***
** 54
**** 5
*
26. Ask the user to enter a list of strings. Create a new list that contains only those strings
which start with a vowel.
27. Write a program to create a nested tuple to store marks of three subjects for five students.
Compute the total marks and average obtained by each student.
28. Write a program to read a list of ‘n’ integers from the user. Create two new lists, one having
all positive numbers and the other having all negative numbers. Print all threelists.
29. Given a tuple pairs = {(2,5),(4,2),(9,8),(12,10)} , count the number of pairs (a,b) such that
both a and b are even.
30. Write a program to perform various list operations using menu driven operations.
a. Add element c.Delete element e. Display list
b. Modify element d. Add another list f. Exit
31. Write a program to accept age of employees & count the number of employees in the following
age groups.
a. 26-35 b. 36-45 c. 46-55
32. Create a dictionary whose keys are month names and whose values are number of days in the
corresponding months. Perform the following:
• Ask the user to enter a month name, and use dictionary to tell how many days are in the
month.
• Print out all of the months with 31 days.
• Print out all of the keys in alphabetical order.
33. Write a program to repeatedly ask user to enter a team name and now many games the
team has won or last.
a) Using dictionary, allow the user to enter team name and print out the team’swin
percentage.
b)Using it to create a list whose entries are the number of runs of each team.
c) Using dictionary create a list of all teams having winning records.
***********************************************
f~~U'IO.'V t : G·~·
__,
P,g,N~ I J
1npu.J:' I f' > y OJ\d
't cu p'l'i'tlt..Jp~,N.Jt
'~ i·......_ ~"n'o,),
.n,Jt
C.Je,v..le>Jt.
s:-: { p*.,iJJ/100
a.~ r"D+Crlroo)l*e
Ci~ (). - L
Swp
~v.t_:
r.nter pnnciple: UbUU
Enter rate: 10 ! ;,
Teachcr\filgnatwe _ _ _ _ _ _ __
\.
..i