Created
October 21, 2016 20:20
-
-
Save joetechem/1a5d0e75b0ef4e0901b32f76e40f3333 to your computer and use it in GitHub Desktop.
make_your_grocery_list.py
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
# a program to make your own grocery list | |
# What happens: python asks for a few items and their prices to be put into a grocery list | |
# this program shows functions, comments, varaiables, user input and FLOAT | |
print("give me a food product you want in your grocery list") | |
food = raw_input() | |
#foodp = int(input('enter food foodp = int(input('enter food pric: ')) | |
#print("what is the price of that food?") | |
#food_price = raw_input() | |
foodp = float(input('enter food price: ')) | |
print("give me a drink to put on your list") | |
drink = raw_input() | |
#print("what is the price of the drink?") | |
#drink_price = raw_input() | |
drinkp = float(input('enter drink price: ')) | |
print("give me a dessert item") | |
dessert = raw_input() | |
#print("what is the price of the dessert?") | |
#dessert_price = raw_input() | |
dessertp = float(input('enter dessert price: ')) | |
my_grocery_list =[food, drink, dessert] | |
# prices = (food_price, drink_price, dessert_price) # is this a tuple? | |
prices = [foodp, drinkp, dessertp] | |
print("do you want me to show you all the items in your grocery list so far?") | |
answer1 = raw_input() | |
print(my_grocery_list) | |
print("do you want the individual prices of each item in your grocery list?") | |
answer2 = raw_input() | |
print(prices) | |
print("do you want me to add up the total of your list?") | |
answer3 = raw_input() | |
print(foodp + drinkp + dessertp) | |
#print("do you want to replace an an item in your list?") | |
#answer4 = raw_input() | |
#my_grocery_list[2] = 'juice' | |
#print(my_grocery_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment