Python Practice Programs
Python Practice Programs
1. If the marks obtained by a student in five different subjects are input through the keyboard,
find out the aggregate marks and percentage marks obtained by the student. Assume that
the maximum marks that can be obtained by a student in each subject is 100.
2. Write a program that inputs the initial velocity, acceleration and time values from the user.
The program should then compute final velocity using Newton’s first equation of motion and
distance travelled according to Newton’s second and third equations of motion, respectively.
3. Write a C-Program to swap two integer numbers without and with using third variable.
4. Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a program
to convert this temperature into Centigrade degrees.
6. There are 3600 seconds in a hour and 60 seconds in a minute. The software company
attendance system is being designed in a new way. The boss has required software to
calculate the office hours of the employees which can accept the employee office hours in
the form of seconds and outputs the equivalent time in the form of hours minutes and
seconds.
7. Write a program that takes a 3 digit number as an input and outputs the reverse of the
number. (Hint: It takes the digit as a single input and separates the digits using the modulus
and division operator.)
17. Find the value of F (centripetal force) for given values of mass ‘m’, velocity ‘v’ and
radius ‘r’ (where F = mv2 / r)
18. Find the value of A such that A = (4x – 3y) / 2z
19. Find the value of distance ‘D’ for given values of ‘x’, ‘v’,‘t’, ‘a’
(where D = x + vt + 1/2at2)
20. Find the value of A such that A = (a - b)2 / 2c
21. Find the value of E (total energy) for given values of ‘m’, ‘v’, ‘g’, ‘h’
(where E = mv2 / 2 + mgh)
22. Find the value of A such that A = (a + b)2 – 2ab
23.