Hi there, I'm struggling mightily on this problem. Write a program that determines if you need an oil change. This program should determine if your car needs an oil change. Assume you change your oil every 7,500 miles and you want to change the oil if you’re within 500 miles of that number. Please prompt the user for the current mileage recorded on the car and also for the mileage recorded on the car at the time of the last oil change. Then, please let the user know if it’s time to change the oil. Be sure to check for invalid entries (e.g., if the mileage at the time of the last oil change is greater than the current mileage) and, if there are invalid entries, please continue to prompt the user. Here is my code: input('Enter the number of miles') x=int(input('Enter the last milage you went for an oil change.'))
if x>5000: print('You need an oil change.') else: x<5000 print('No oil change.') I'm getting two different answers as outputs. I don't know why. thanks for your help. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor