31.5k views
4 votes
Read the following code used to calculate the difference in points between basketball Team A and Team B:

scoreA = float(input("What was team A's score?"))
scoreB = float(input("What was team B's score?"))
pointsDifference = scoreA - scoreB

There is an error in the code. Which function should be used, and why?

A. float(); points require decimals
B. int(); points are entered as whole numbers
C. print(); points are printed on scoreboards
D. str(); points are fixed, so no calculation is necessary

1 Answer

4 votes

Answer:

C. print(); because the result is not displayed yet

User Jeff Wilbert
by
7.6k points