I am sorry to have to waste your time with such an easy problem but I am stuck with some coders block on this one. I know it is definitely an easy fix I just cannot seem to wrap my head around it at the moment... I do feel quite foggy at the moment though...
Here is my code
#Ian Olsen #calculate distance traveled and display each hour. def main(): #Get MPH car traveled at speed_traveled = int(input('How many MPH did you travel at? : ')) #Get hours traveled hours_traveled = int(input('How many hours did you travel? : ')) #start loop and accumlator for hours print('Hour Distance Traveled') print('---------------------------------') for hour in range(hours_traveled): total = 0 #math displaytotal = speed_traveled * hours_traveled total += displaytotal print(hour+1, displaytotal, sep='\t\t') main()
I have it to only display the displaytotal which is the grand total.. I am lost as to how to get it to display the total for each hour.