0

Generator object

Why does this code return a generator object print(int (x) for x in input().split())

17th Aug 2022, 12:08 PM
Haxsys
Haxsys - avatar
1 Answer
+ 3
Because that is what the code does... If you wanted a list for example, you could make it a list comprehension: print([int (x) for x in input().split()])
17th Aug 2022, 12:10 PM
Lisa
Lisa - avatar