PYTHON (BEGINNER) program that allows the user to choose any of the three sports options...

50.1K

Verified Solution

Question

Programming

PYTHON (BEGINNER) program that allows the user to choose any of the three sports options described below and computes the relevant statistic in each case:Quidditch Score Total: Determined based on the number of goals and whether or not the snitch was caught. A goal is scored by propelling the quaffle through a hoop and each earns the team 10 points. If a team catches the snitch, that team earns an additional 30 points. The snitch can be caught at most once. More details on Quidditch available from the International Quidditch Association.(Simplified) Quarterback Rating: Defined as100 * [5(completions/attempts – 0.3) + 0.25(passing_yards/attempts-3) + 20(touchdown_passes/attempts) + 2.375 – (25 * interceptions/attempts)]/6,where attempts is the number of passing attempts made, completions is the number of completed passing attempts, touchdown_passes is the number of passes for a touchdown, and interceptions is the number of times the ball was intercepted. A perfect passer rating in the NFL is considered to be a 158.3. In addition to the rating, tell the user whether or not the quarterback is a perfect passer.Gymnast Score: Begins with six scores, one for difficulty and five for execution, each between 0 and 10. Of the execution scores, the highest and lowest are dropped. The final score is given by the sum of the difficulty score and the average of the three remaining execution scores.Input Validation:Check if you are going to divide by zero when relevant, and do not do the calculation if that is the case.Before typecasting user inputs to an int, check that it is only digits, and don’t typecast or do the calculation otherwise. (For this assignment, do not worry about checking if floats are valid.)In any case where an error is detected, output an error message. Do not continue the calculation. You may additionally output a result of zero in such a case.

Answer & Explanation Solved by verified expert
3.9 Ratings (575 Votes)
1 ANSWER GIVENTHAT import sys def Quidditchgoal1goal2snitch score1 goal110 score2 goal210 ifsnitch1 score130 elifsnitch2 score230 printTeam 1 scored strscore1n printTeam 2 scored strscore2 if score1score2 printnTeam 1 won elif score2score1 printnTeam 2 won else printnIts a tie def Quarterbackcomppassyardattempttouchdowninter score 5compattempt03 025passyardattempt3 20touchdownattempt 2375 25interattempt1006 if score 1583 printThe    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students