0
i am not getting correct even odd numbers count from given range of numbers (range -5 to 7)...
a = int(input()) b = int(input()) even_count = 0 odd_count = 0 for i in range(a, b+1): if (i%2) == 0: even_count = even_count +1 else: odd_count = odd_count + 1 print(even_count) print(odd_count)
3 Réponses
+ 5
anil jampani
Please don't paste your code in the tags. Rather just put Python as the language name relevant to the question.
+ 2
Hi! I have your program outputs two numbers 6 and 7. I don't see any errors. what is the wrong calculation?
0
it was certainly not very convenient, but I inserted this code in the code playground section and got the result