FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixes tests 4 and 6 · kyclark/tiny_python_projects@d33b237 · GitHub

Commit d33b237

Browse files
committed
Fixes tests 4 and 6
1 parent a889832 commit d33b237

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

‎02_crowsnest/crowsnest.py‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def get_args():
1313
"""Get command-line arguments"""
1414

1515
parser = argparse.ArgumentParser(
16-
description='Shout out to captain about incoming threat',
17-
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
16+
description="Shout out to captain about incoming threat",
17+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
18+
)
1819

19-
parser.add_argument('word',
20-
metavar='threat',
21-
help='Incoming threat to ship',
22-
type=str)
20+
parser.add_argument(
21+
"word", metavar="threat", help="Incoming threat to ship", type=str
22+
)
2323

2424
return parser.parse_args()
2525

@@ -31,16 +31,14 @@ def main():
3131
args = get_args()
3232
str_arg = args.word
3333

34-
str_arg = str_arg.lower()
35-
36-
if str_arg[0] in 'aeiou':
37-
article = 'an'
34+
if str_arg[0].lower() in "aeiou":
35+
article = "an"
3836
else:
39-
article = 'a'
37+
article = "a"
4038

41-
print(f'Ahoy, Captain, {article} {str_arg} off the larboard bow!')
39+
print(f"Ahoy, Captain, {article} {str_arg} off the larboard bow!")
4240

4341

4442
# --------------------------------------------------
45-
if __name__ == '__main__':
43+
if __name__ == "__main__":
4644
main()

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL