0
Why is there TypeError in line 2?
import random value = list(random.randint(1,6)) print(value) Error is:- Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'int' object is not iterable
1 Odpowiedź
+ 4
You are trying to create a list out of a number (in this case a random one), and that doesn't work.
You can only make a list out of iterables, like other lists, tuples, strings etc.