+ 1
Why this is showing error?
while True: x=input('Enter Table: ') y=x*10 numbers = list(range(eval(x), eval(y), eval(x))) print(numbers)
5 Answers
+ 1
eval() is used to evaluate a string like an expression. You can't use it on an arbitrary variable
There's no need to use eval() in your code, but if you want to use it, try something like numbers = eval(f'range({x}, {y}, {x})')
+ 1
Those are normally not good signs đ
+ 1
But it will ask for input after every loop
0
It is saying memory error on code playground
On IDE the python console just vanished and window is closed
- 1
while True without break means infinite loop.