// This is equivalent to
for i in range(1,3):
print(i, end=' ')
// Any function that includes "yield" is called a generator and it works like range(), so that you can use them both in a loop like "for", but there are differences, e.g. you can use a generator inside next() but you cannot use range() inside next() because range() is stateless
With f(2), n = 2, so the range will be range(1, {2+1}) or range(1,3). The iterations of i would then be 1 and then 2 with yield sending each iteration back to "for i in f(2)". Hope this explains it.
upvoted 3 times
...
...
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
CC_DC
1 year, 11 months agomacxsz
3 years, 2 months agoNorasit
3 years, 2 months agorocky48
3 years, 3 months agorocky48
3 years, 3 months agoBacky
3 years, 4 months agoruydrigo
3 years, 7 months agotechdawgs
3 years, 7 months ago