Question: Write a function that gives the users four random integers between 1 and 10 and ask them to enter the square number of them. If

Write a function that gives the users four random integers between 1 and 10 and ask them to enter the square number of them. If the user answers all of them correctly, congratulate them. Otherwise, show them the right answer In [ ]: # Step 6: Import numpy -- ALWAYS import all the libraries you need at the beginning! import numpy as np #Step 1: Function creation -- refer to the last Lab for the syntax of function creation # does our function take parameters? # Create your function here: #Step 2: Create an array of four random integers between 1 and 10 #Step 3: Print your numbers #Step 4: Prompt the user to enter four numbers, ONE AT A TIME. Use a Loop to store these four numbers in a new array # HINT 1: We could take all four numbers in through one Line, but to practice Loop, Let's do it the hard way # HINT 2: You can start by creating an empty array -- np.array([]), then appending to it one at a time HINT 3: Remember, input() only returns STRINGS. You need to turn them into integers #
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
