Dec-03-2018, 06:07 PM
The first 16 lines of your code are the same 4 lines repeated 3 times. Almost any time you're copy-pasting code, you could clean it up and write a function that does it cleaner. In this case, those code could be replaced with a function, and then just calling it three times, like so:
The program won't go faster if you use smaller variable names, so it's better for you (and anyone else who reads the code) to use meaningful names. In this case, something like
sValue = get_int_input("Enter the starting value") eValue = get_int_input("Enter the ending value") iValue = get_int_input("Enter the increments you'd like to count in")Unrelated, but those aren't great variable names. They don't give any indication as to what they mean, aside from the fact that they hold some sort of value. But holding a value isn't meaningful, since that's what all variables do :p
The program won't go faster if you use smaller variable names, so it's better for you (and anyone else who reads the code) to use meaningful names. In this case, something like
starting_point
, ending_point
, and increment_by
perhaps.