Computer Science
Write a Python program to generate a random number between 0 and 9.
Python
Python Modules
1 Like
Answer
import random
random_number = random.randint(0, 9)
print("Random number between 0 and 9:", random_number)
Output
Random number between 0 and 9: 2
Random number between 0 and 9: 3
Answered By
1 Like
Related Questions
Write a function to calculate volume of a box with appropriate default values for its parameters. Your function should have the following input parameters :
(a) length of box ;
(b) width of box ;
(c) height of box.
Test it by writing complete program to invoke it.
Consider the amount of donations received by a charitable organization given as under:
donations = [100, 60, 70, 900, 100, 200, 500, 500, 503, 600, 1000, 1200]
Now write a Python program to calculate the average amount obtained and median of the above data.
Define a function which accepts n as an argument and prints Fibonacci series till n.
Consider the temperature given below for the month of June in North India. Calculate the average temperature and median value. This temperature gets dipped with a variation of 20°C in the month of December. Write a Python program to calculate the changed median value and average temperature.
Location Temperature (in °C) Delhi 41 Shimla 32 Chandigarh 43 Rohtak 40 Srinagar 28 Sri Ganganagar 45