Python Fundamentals Level-1 Test paper¶
- All questions carry 2 marks.
- Total 10 marks.
- Duration 20 minutes.
1. Write a program to find the BMI (Body mass indeex) with given weight (in kg) and height (in meter).¶
BMI = $weight \div height^2$
2. Write a program to find the area of a circle with radius given by the user.¶
area_of_circle = $\pi*r^2$
3. Write a program to calculate the hypotenuse of a right angled triangle using Pythagoras theorem.¶
hypotenuse = $\sqrt{base^2 + height^2}$
4. Write a program to find the distance between two points on a graph with co-ordinates (x1, y1) and (x2, y2).¶
distance = $\sqrt{(x2-x1)^2 + (y2-y1)^2}$
5. Write a program to mimic a dice that generates a number randomly between 1-6.¶
Use random module and choice() functions