-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeows.py
73 lines (60 loc) · 1.28 KB
/
meows.py
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""
MEOWS = 3
for _ in range(3):
print("meow")
"""
"""
class Cat:
MEOWS = 3
def mewo(self):
for _ in range(Cat.MEOWS):
print("meow")
cat = Cat()
cat.mewo()
"""
"""
def meow(n):
for _ in range(n):
print("meow")
meow(int(input("Number: ")))
"""
"""
def meow(n: int):
for _ in range(n):
print("meow")
number: int = int(input("Number: "))
meow(number)
"""
def meow(n: int) -> str:
"""
Meow n times.
:param n: Number of timmes to meow
:type n: int
:raise TypeError: If n is not an int
:return: A sring of n meows, one per line
:rtype: str
"""
return "meow\n" * n
'''
number: int = int(input("Number: "))
meows: str = meow(number)
print(meows, end="")
'''
'''
import sys
if len(sys.argv) == 1:
print("meow")
elif len(sys.argv) == 3 and sys.argv[1] == "-n" :
n = int(sys.argv[2])
print("meow\n" * n, end="")
# for _ in range(n):
# print("meow")
else:
print("usage: meows.py")
'''
import argparse
parser = argparse.ArgumentParser(description="Meow like a cat")
parser.add_argument("-n", default=1, help="number of times to meow", type=int)
args = parser.parse_args()
for _ in range(args.n):
print("meow")