in Python: create a pythonprogram that determines stats for a basketball team fr
ID: 3759332 • Letter: I
Question
in Python: create a pythonprogram that determines stats for a basketball team
free throws are 1 point
report free throws made and free throws attempted (integrers)
more free throws made than attempted should return an error message
report the percentage(float)
no shots attempted should show "none attempted"
___
this is as far as i got
total = int(input('Free Throws Attempted? '))
for shot in range(0):
number = int(input('Enter free throws attempted: '))
total = total + 1
print('The total of free throws attempted is', total)
Explanation / Answer
#!/usr/bin/python
FreeThrows= int(input('Enter the number of Free Throws'))
freeThrowsAttempted= int(input('Enter free throws attempted: '))
print "BASEBALL TEAM STATUS"
print "No.of. free throws:",freeThrows
if freeThrowsAttempted==0:
print "None Attempted!!!"
else:
print "No.of. free throws Attempted:",freeThrowsAttempted
if freeThrows>freeThrowsAttempted:
print "Error: Free throws are more than attempted"
else:
percentage=freeThrows/freeThrowsAttempted
print "Percentage:",percentage
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.