-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsleep.py
More file actions
49 lines (41 loc) · 810 Bytes
/
sleep.py
File metadata and controls
49 lines (41 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'''
def main():
n = int(input("What's n? "))
for i in range(n):
print("🐑" * i)
if __name__ == "__main__":
main()
'''
'''
def main():
n = int(input("What's n? "))
for i in range(n):
print(sheep(i))
def sheep(n):
return "🐑" * n
if __name__ == "__main__":
main()
'''
'''
def main():
n = int(input("What's n? "))
for s in sheep(n):
print(s)
def sheep(n):
flock = []
for i in range(n):
flock.append("🐑" * i)
return flock
if __name__ == "__main__":
main()
'''
# yield iterator
def main():
n = int(input("What's n? "))
for s in sheep(n):
print(s)
def sheep(n):
for i in range(n):
yield "🐑" * i
if __name__ == "__main__":
main()