From b41364c2e665f3d6de48e4d984aabfc10a1a4316 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:56:19 -0500 Subject: [PATCH] Completed exercise 3-9 Dinner Guests --- Chapter_03/3-9_dinnerGuests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Chapter_03/3-9_dinnerGuests.py diff --git a/Chapter_03/3-9_dinnerGuests.py b/Chapter_03/3-9_dinnerGuests.py new file mode 100644 index 0000000..30a60cf --- /dev/null +++ b/Chapter_03/3-9_dinnerGuests.py @@ -0,0 +1,18 @@ +# Excercise 3-9 Dinner Guests +# Learning Objective: Utilize len() method on an earlier program. + +#Guest List Ex 3-4 +guests = ['Tim', 'Steve', 'Aaron', 'Paul', 'Luke', 'Derek'] + +""" +print(f"Hi there {guests[0]} please come over for dinner!") +print(f"Hi there {guests[1]} please come over for dinner!") +print(f"Hi there {guests[2]} please come over for dinner!") +print(f"Hi there {guests[3]} please come over for dinner!") +print(f"Hi there {guests[4]} please come over for dinner!") +print(f"Hi there {guests[5]} please come over for dinner!") +""" + +print("We are inviting " + str(len(guests)) + " guests.") +# str method hasn't been mentioned yet but given the sytax error provided, +# it was needed to convert the int value to a string. \ No newline at end of file