Video <<-- App 4: Journal app and file I/O: Complex conditionals and, or, and not
bfmcneill opened this issue · 1 comments
bfmcneill commented
mikeckennedy commented
Hi there. It looks REALLY close to the same as the code here:
while cmd != 'x' and cmd:
cmd = input('[L]ist entries, [A]dd an entry, E[x]it: ')
cmd = cmd.lower().strip()
if cmd == 'l':
list_entries(journal_data)
elif cmd == 'a':
add_entry(journal_data)
elif cmd != 'x' and cmd:
print("Sorry, we don't understand '{}'.".format(cmd))
But the difference is if you press x to exit. I think in your loop you will see two lines:
"Sorry we don't understand X"
"Done, goodbye"
Whereas in mine, you'll only see the last line on exit. Is that right from reading the image and executing it in my mind? :)
Best,
Michael