import pandas as pd

print_buffer = "\n" + "-" * 60 + "\n"

inventory = {"Skittles" : [5, 2.50], "M&M's" : [12, 2.40], "Sour Patch" : [4, 3.00], "Twix" : [8, 2.00], "Snickers" : [10, 2.00]}

###############
# Convert this inventory dictionary into a Pandas Dataframe with the candy names
# as the row values and quantity as column 1 and price as column 2 and print it
# Hint: Look for a method that allows you to convert a dictionary into a DataFrame
# Hint: What additional arguments would you need to specify to configure the DataFrame as mentioned above?

df = """FILL THIS IN"""
print("Inventory DataFrame:\n", df)

print(print_buffer)


###############
# Print the rows of the DataFrame, or the names of the candies in stock, in a list
# Hint: Something in the attributes and underlying data section of the documentation may be helpful

candies = list("""FILL THIS IN""")
print("Candies in stock:", candies)

print(print_buffer)


###############
# A customer wants to know how many Twix bars there are and what price they are, print this info for them
# Hint: Look for something in the documentation that would allow you to index into a
# row of a DataFrame and print all column values for that row

"""FILL THIS IN"""

print(print_buffer)


###############
# The customer then decides to buy 2 Twix bars - uupdate the count of Twix bars in the DataFrame
# Hint: Use the same piece of code as in the previous problem, you will have to adapt it slightly

"""FILL THIS IN"""

print("Inventory DataFrame:\n", df)

print(print_buffer)


###############
# It's National Chocolate Day! We want to add a discount column before our Price column in
# the DataFrame letting customers know that all choolates are discounted and other candies
# are not - use True to represent that a chocolate is dicounted and False otherwsie
# Hint: Look for a method that lets you add a column to your DataFrame

"""FILL THIS IN"""
print("Inventory DataFrame:\n", df)

print(print_buffer)


###############
# Now that you've inserted a Discount column, create a new column containing the updated
# price of each item. Remember, if a row has a Discount value of True, we want to take 25%
# off its price, if a row has a Discount value of False, we don't want to change its price
# Hint: First create a new column Updated Price that contains the price of each item with
# a 25% discount - disregard if an item is not on discount for now

"""FILL THIS IN"""
print("Inventory DataFrame:\n", df)

print(print_buffer)


###############
# Hint: Since we don't want to discount every candy (just chocolates), we need to set the
# Updated Price column value for all non chocolate candies to the Price column value. Look
# for a function in the documentation that allows you to replace column values WHERE a
# condition is False, in this example where it is not a dicounted item

"""FILL THIS IN"""
print("Inventory DataFrame:\n", df)

print(print_buffer)


###############
# Now that we have the Updated Price column, remove the Price column

"""FILL THIS IN"""
print("Inventory DataFrame:\n", df)

print(print_buffer)