- Write a function with no return value in Python: print_random_number(). When called, it will print a random number between 10 to 20.
- Write a function with return value in Python: get_random_number(). When called, it will return a random number between 10 to 20. Call the function and print the result as “Random number is <return value>”.
- Write a function with return value in Python multiply_numbers. This function would have 3 parameters and multiply all of them together and return the result. Call the function and get the returned result. Combine the return result with “Multiplication result is <return result>” . So when 1,2,3 are passed to the function, the program will take the result of the multiplication, which is 6, and print “Multiplication result is 6”.
- Write a function with return value in Python, “buy_game“. One parameter: amount_of_money. Inside the function if amount_of_money is less than 10, return “monopoly”. If amount_of_money is between 11 to 20 then return “mario”. If it is greater than 20 then return “zelda”. Ask user “How much money you have: “. Whatever numbers user enter, pass this when calling “buy_game” function. Get the result and print the game that the user get. Look at below
How much money you have: 15 With $15, you get 'MARIO' game. How much money you have: 23 With $23, you get 'ZELDA' game.