Python Forum
Need help with an assignment, not an answer.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with an assignment, not an answer.
#4
I think I misunderstood the assignment a bit. I was thinking given the user entering 'spam' three times, the ['spam', 'spam', 'and', 'spam']. But I guess the goal is actually ['spam', 'spam', 'and spam'].

In that case you want to do three things when newWord is empty: add 'and ' to the start of newWord, append newWord to listToPrint, and break.

If you want the list to print at the end, you need to move (or copy) line 2 to the end of the program.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Need help with an assignment, not an answer. - by ichabod801 - Oct-01-2019, 12:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Answer for newbie, Sqlite3 Froger 2 903 Sep-27-2023, 05:33 PM
Last Post: noisefloor
  Coding answer for newbie cg3 2 1,209 Aug-05-2023, 12:17 PM
Last Post: jefsummers
  What am I doing wrong to not get the answer pav1983 7 3,763 Jun-25-2020, 08:53 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020