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