File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change 2
2
"""
3
3
Author : Ryan Alcoran <r.alcoran>
4
4
Date : 2020-11-15
5
- Purpose: Rock the Casbah
5
+ Purpose: Crow's Nest
6
6
"""
7
7
8
8
import argparse
@@ -21,28 +21,14 @@ def get_args():
21
21
help = 'A word' )
22
22
return parser .parse_args ()
23
23
24
- # --------------------------------------------------
25
- def is_vowel (char ):
26
- """Check if character is a vowel"""
27
-
28
- ch = char .lower ()
29
- if (ch == 'a' or ch == 'e' or ch == 'i' or ch == 'o' or ch == 'u' ):
30
- return True
31
- else :
32
- return False
33
-
34
24
# --------------------------------------------------
35
25
def main ():
36
26
"""Make a jazz noise here"""
37
27
38
28
args = get_args ()
39
29
word = args .word
40
- article = ''
41
- if (is_vowel (word [0 ]) == True ):
42
- article = 'an '
43
- else :
44
- article = 'a '
45
- print ('Ahoy, Captain, ' + article + word + ' off the larboard bow!' )
30
+ article = 'an' if word [0 ].lower () in 'aeiou' else 'a'
31
+ print (f'Ahoy, Captain, { article } { word } off the larboard bow!' )
46
32
47
33
# --------------------------------------------------
48
34
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments