Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Jul 21st, 2018
69
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
def getrange(n):
```generator function```
i = 0
while i < n:
yield i
i += 1
n = 3
# calling generator function
a = getrange(n) # a is an iterator
next(a)
>>0
next(a)
>>1
Add Comment
Please,
Sign In
to add comment
Public Pastes
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 7 min ago | 0.39 KB
Untitled
JSON | 14 min ago | 0.03 KB
Arduino - Lettura sensore differenziale MS452...
Arduino | 1 hour ago | 1.59 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🎁
GetText | 1 hour ago | 0.38 KB
Задача 5
Python | 1 hour ago | 0.57 KB
CC Mekanism Induction Battery Monitoring V2
Lua | 1 hour ago | 6.67 KB
Задача 4
Python | 1 hour ago | 0.68 KB
Задача 3
Python | 2 hours ago | 1.05 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!