Question: Your task is to write 2 functions and a Python program. One of your functions is calledposition and one is called awards Your program code

Your task is to write 2 functions and a Python program. One of your functions is called"position" and one is called "awards Your program code will ask the race administrator to input num, the number of racers. Your program will use a for loop in order to process each racer. It will ask the administrator to enter the name of the racer. The program will then invoke the awards function and pass to it the function named "position" along with the number of racers. For example, the program might invoke the awards function with this statement: feedbacks awards (position(num)) The position function's job is to prompt the judge to enter the finish position of the racer. The function then determines if the finish position is valid. To be valid, the position needs to be between 1 and num, where num is the number of racers. If the finish position entered is valid, the function will return its value to the awards function. If the finish position is not a valid number, the function prompts the user to enter a valid number As part of the validity test, you could embed the following sentence in a while loop: finishposition = int (input (str(num) + " is the highest possible finish position and 1 the lowest, Enter valid finish position: ")) The awards function's job is to translate the valid finish position into a message and then return that message to your program. It returns "Congratulations, you won Gold" if the racer came in first. "Congratulations, you won Silver" if the racer came in second, and "Congratulations, you have won Bronze" if the racer came in third. For all other finish positions, it returns "Thank you for helping to raise money for this worthy cause." Your program then prints the name of the racer and the message it received from the awards function. Show your program logic is correct by running the program several times to test whether it correctly processes position numbers 0,1,2,3 and 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
