- 2
The question is in the description pls help me understand it can't understand it tomorrow is exam
number= int(input("Enter your age")) if Age%2 == 0: number=0 while (number <= Age) Print(number) number = number + 2 else number=1 while (number <= Age): print (number) number = number+2
2 Réponses
0
I didn't see any question in the description, here's only code.
edit]:
here is your corrected code, but you should have declared 'Age'
number= int(input("Enter your age"))
if Age%2 == 0:
number=0
while (number <= Age):
print(number)
number = number + 2
else:
number=1
while (number <= Age):
print (number)
number = number+2
0
number= int(input("Enter your age")) // you are taking a number as input
if Age%2 == 0:// ur checking condition if age%2(remainder)is zero or not
number=0
while (number <= Age)//checking the condition if the number(which is 0 ) is less than or equal to age
print(number)// printing the value of number
number = number + 2// here ur incrementing number by 2times
else:
number=1
while (number <= Age): //checking the condition if the number(which is 1 ) is less than or equal to age
print (number)
number = number+2