IN PYTHON:
Winner of the Chevy and Ford Racing Teams
Scenario
There are eight cars in each team called Chevy and Ford. One car from each team races its opponent on the drag strip. Read in the racing times for the eight Chevy cars and then read in the times for the eight Ford cars. Store the times into lists or tuples called Chevy and Ford. Then list the winner of each pair, giving the number of seconds the winner won by. At the end declare which team won based on which team had the most wins. Below is a sample match.
This is sample data for you to use for testing:
The times for the Chevy cars: 5.4 7.2 4.0 9.1 5.8 3.9 6.2 8.1
The times for the corresponding Ford cars: 5.8 6.9 3.9 9.2 5.8 3.8 6.0 8.5
And the winners are:
Chevy by 0.4 sec
Ford by 0.3 sec
Ford by 0.1 sec
Chevy by 0.1 sec
Tie !
Ford by 0.1 sec
Ford by 0.2 sec
Chevy by 0.4 sec
And the winning team is: F O R D !
chevyTime=input('The times for the Chevy cars: ')
fordTime=input('The times for the corresponding Ford cars: ')
chevy=[float(i) for i in chevyTime.split()]
ford=[float(i) for i in fordTime.split()]
chevyWins=0
fordWins=0
print('And the winners are:')
for i in range(len(chevy)):
if chevy[i]<ford[i]:
print('Chevy by {:.1f} sec'.format(-chevy[i]+ford[i]))
chevyWins+=1
elif chevy[i]>ford[i]:
print('Ford by {:.1f} sec'.format(-ford[i] + chevy[i]))
fordWins += 1
else:
print('Tie !')
if fordWins==chevyWins:
print('It was a T I E !')
else:
print('And the winning team is: ',end='')
if fordWins>chevyWins:
print('F O R D !')
else:
print('C H E V Y !')

IN PYTHON: Winner of the Chevy and Ford Racing Teams Scenario There are eight cars in...