Created
November 29, 2014 02:04
-
-
Save maryrosecook/d06014ba4b063d98db04 to your computer and use it in GitHub Desktop.
Lauren's second program
This file contains hidden or 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
# shopping_list = ["apple", "toothbrush", "banana", "black lava"] | |
# shopping_list.append("cheese") | |
# shopping_list.reverse() | |
# print("Shopping List") | |
# for shopping_list_item in shopping_list: | |
# if len(shopping_list_item)<7 or shopping_list_item=="black lava": | |
# print("-" + shopping_list_item) | |
# if (shopping_list_item.get("done")==False): | |
# print ("-" + shopping_list_item.get("name")) | |
# else: | |
# print (checkmark + shopping_list_item.get("name")) | |
def print_shopping_list_item(shopping_list_item): | |
if (shopping_list_item.get("done")==False): | |
print ("-" + shopping_list_item.get("name")) | |
else: | |
print ("✓" + shopping_list_item.get("name")) | |
shopping_list=[{"name": "apple","done": True}, {"name": "banana", "done": False}] | |
for shopping_list_item in shopping_list: | |
print_shopping_list_item(shopping_list_item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment