g = (i for i in range(5)) type(g)
a) class <’loop’>
b) class <‘iteration’>
c) class <’range’>
d) class <’generator’>
g = (i for i in range(5)) type(g)
a) class <’loop’>
b) class <‘iteration’>
c) class <’range’>
d) class <’generator’>
You must be logged in to post a comment.
d
Explanation: Another way of creating a generator is to use parenthesis. Hence the output of the code shown above is: class.