Python Assignments
Python Assignments
Write a Python program which accepts the radius of a circle from the user and compute the
area
2. Write a Python program to check if a number is positive, negative or zero
3. Write a Python function to check whether a number is completely divisible by another
number. Accept two integer values form the user
4. Write a Python program that accepts an integer (n) and computes the value of (n + nn + nnn)
5. Write a Python program to calculate number of days between two dates
6. Write a Python program to get the volume of a sphere, please take the radius as input from
user. V=4 / 3 πr3
7. Write a Python program to get the difference between a given number and 17, difference
cannot be negative
8. Write a Python program to get a new string from a given string where "Is" has been added to
the front. If the given string already begins with "Is" then return the string unchanged
9. Write a Python program to get a string which is n (non-negative integer) copies of a given
string
10. Write a Python program to find whether a given number (accept from the user) is even or
odd, print out an appropriate message to the user.
11. Write a Python program to test whether a passed letter is a vowel or not
12. Write a Python program that will accept the base and height of a triangle and compute the
area (https://www.khanacademy.org/math/basic-geo/basic-geo-area-and-perimeter/area-
triangle/a/area-of-triangle)
13. Write a Python program that will return true if the two given integer values are equal or
their sum or difference is 5.
14. Write a Python program to solve (x + y) * (x + y)
15. Write a Python program to compute the future value of a specified principal amount, rate of
interest, and a number of years.
16. Write a Python program to compute the distance between the points (x1, y1) and (x2, y2).
https://en.wikipedia.org/wiki/Euclidean_distance
17. Write a Python program to convert height (in feet and inches) to centimetres.
18. Write a Python program to calculate the hypotenuse of a right angled triangle
19. Write a Python program to convert the distance (in feet) to inches, yards, and miles. 1 feet =
12 inches, 3 feet = 1 yard, 5280 feet = 1 mile
20. Write a Python program to convert all units of time into seconds.
21. Write a Python program to convert seconds to day, hour, minutes and seconds.
22. Write a Python program to calculate body mass index.
(https://www.thecalculatorsite.com/articles/health/bmi-formula-for-bmi-calculations.php)
23. Write a Python program to convert temperatures to and from Celsius, Fahrenheit
**
***
****
*****
****
***
**
42. Write a Python program to construct the following pattern, using a nested for loop
12
123
1234
12345
1234
123
12
43. Write a Python program to construct the following pattern, using a nested loop number.
1
22
333
4444
55555
666666
7777777
88888888
999999999
44.