Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4834e34

Browse files
feat: Implement 01_hello
1 parent 776b666 commit 4834e34

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

01_hello/hello.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env python3
2+
# Purpose: Say hello
3+
4+
import argparse
5+
6+
7+
def get_args():
8+
parser = argparse.ArgumentParser(description='Say hello')
9+
parser.add_argument('-n', '--name', help='Name to greet', default='World')
10+
return parser.parse_args()
11+
12+
13+
def main():
14+
args = get_args()
15+
print(f'Hello, {args.name}!')
16+
17+
18+
if __name__ == '__main__':
19+
main()

0 commit comments

Comments
 (0)