Hello, I am new to the forums and I am just starting to learn python. I have been writing the following program and have ran into a problem with getting it to work right. If anyone can offer some advice on what I am doing wrong I would be thankful. This program is suppose to get a starting value and an ending value and then print just the even numbers, including the starting and ending values if necessary. My problem is if I start with an even number and end with an even number it doesn't print the last even number.
Also any advice on things I can do better in writing the code would be great to hear I want to be good at coding.
Thanks again for anyone who reads this and helps.
def main(): x = input('Enter a starting value: ') y = input('Enter an ending value: ') for i in range(x, y, 2): if(x%2!=0): i = i + 1 print i else: print i