Re: [Tutor] Tutor Digest, Vol 157, Issue 39

2017-03-19 Thread Marc Sebek
Hi Rafael You are appending quit to the list, before checking to see if quit has been typed. You could move the "if Statement" up in the code and add an else statement, so Quit is not appended to the list first thing. while True: activity = input(prompt) if activity == "quit":

Re: [Tutor] tiny, little issue with list

2017-03-19 Thread Alan Gauld via Tutor
On 19/03/17 12:17, Rafael Knuth wrote: > LogActivities = [] > prompt = ("What have you done today? ") > prompt += ("Enter 'quit' to exit. ") I'm not sure why you put that on two lines but thats just a nit pick... > while True: This will loop forever unless you explicitly break, return or hit an

[Tutor] tiny, little issue with list

2017-03-19 Thread Rafael Knuth
LogActivities = [] prompt = ("What have you done today? ") prompt += ("Enter 'quit' to exit. ") while True: activity = input(prompt) LogActivities.append(activity) if activity == "quit": print("Let me recap. This is what you've done today: %s." % ", " .join(LogActivities))