Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create field_goals.py that will ask for basketball stats and write the results to a file. Ask for the player's name, team, 2 point shot attempts,

image text in transcribed

Create field_goals.py that will ask for basketball stats and write the results to a file. Ask for the player's name, team, 2 point shot attempts, and the number made. Implement a function that will take the attempts and shots made as input and return the percentage as a real number (i.e., float). Write the player's name and field goal percentage to the team's file. Format the percentage to display a single decimal place with the % sign included. For example, a player that makes half of his shots should have a 50.0% field goal percentage (FG%). Use the append mode to write the results to a file that has the team name followed by "dat". Use a function to write the data to the file as well. Example run: Player's name? Jokic Player's team? Nuggets Number of field goal attempts: 849 Number of field goals made: 440 The output in the Nuggets.dat file should be: Jokic has a 51.8% field goal percentage

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions