Skip to content

Commit ffa532b

Browse files
committed
ch02: make article dependent on first letter
1 parent cf29487 commit ffa532b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

02_crowsnest/crowsnest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ def main():
2828

2929
args = get_args()
3030
word = args.word
31+
article = "an" if word[0].lower() in "aeiou" else "a"
3132

32-
print("Ahoy, Captain, a " + word + " off the larboard bow!")
33+
print(f"Ahoy, Captain, {article} {word} off the larboard bow!")
3334

3435

3536
# --------------------------------------------------

0 commit comments

Comments
 (0)