Last active
April 10, 2018 22:08
-
-
Save lowkeyshift/9b1bc5126d3223aafcc5f80d2b12d5c5 to your computer and use it in GitHub Desktop.
Jessica_code_practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Master_list = [] | |
while True: | |
grocery = input('Please enter grocery item: ') | |
if grocery.lower() == 'exit': | |
print('You did not enter a grocery item, please try again.') | |
break | |
else: | |
Master_list = Master_list + [grocery] | |
print('This is your listed grocery items you have entered.') | |
for grocery in Master_list: | |
print(' ' + grocery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See what I did with the if/else statement. If exit stop everything, but else run the rest of the code.