0
Please correct where I am going wrong as i cannot get output
def number_game(x,y): num = range(10,2) for i in num: if 10 > 2: print(i+1 in (10,2)) else: return i%2 == 1
2 Answers
+ 2
I think you should create num variable like this.
num=range(10,2,-1)
Now it can iterate.
+ 1
The statement: "num = range(10,2)"
Creates an object of "range" type.
It can't be iterated, so it returns nothing in the next line: "for i in num".