127k views
2 votes
Can someone help me with solving this program using coding?

Can someone help me with solving this program using coding?-example-1

1 Answer

3 votes

Answer:

Step-by-step explanation:

The following program is written in Python and holds all of the powers and amounts in a dictionary called inventory which can be changed, or the values can be increased like any dictionary. The data is then called and outputed to the user as an Inventory like the one shown in the picture.

def Inventory():

inventory = {'Mushroom': 5, 'Super Bell': 5, 'Boomerang': 5, 'Fire Flower': 5}

print("Mario's Inventory")

print("Power Amount")

for x in inventory.keys():

spaces = ''

for y in range(20 - len(x)):

spaces += " "

print(x + spaces + str(inventory.get(x)))

Inventory()

Can someone help me with solving this program using coding?-example-1
User James Buck
by
7.2k points