Write a python function get the random number from the given range and square the number


Topic: Write a python function get the random number from the given range and square the number

Solution

import random 
min_value = 10
max_value = 20
def square(x):
    return x*x
def get_square_of_random_number(min_value,max_value):
    return square(random.randint(min_value,max_value))
get_square_of_random_number(min_value,max_value)



List all Python Programs