
Build a complete Roblox shop where you can buy AND sell items repeatedly!
Create these variables:
catalog = { "Dominus": 50000, "Sparkle Time Fedora": 15000, "Valkyrie Helm": 25000, "Rainbow Wings": 8000, "Golden Crown": 12000, "Bloxy Cola": 500 } inventory = {} items_bought = 0 items_sold = 0
robuxExpected Output:
How much Robux do you have? 30000
Create a function or section that prints:
=== ROBLOX CATALOG SHOP ===
[List all catalog items and prices]
Your Robux: [robux]
Your Inventory: [inventory]
Items Bought: [items_bought]
Items Sold: [items_sold]
Expected Output:
=== ROBLOX CATALOG SHOP ===
Dominus: 50000 Robux
Sparkle Time Fedora: 15000 Robux
Valkyrie Helm: 25000 Robux
Rainbow Wings: 8000 Robux
Golden Crown: 12000 Robux
Bloxy Cola: 500 Robux
Your Robux: 30000
Your Inventory: {}
Items Bought: 0
Items Sold: 0
Create a while True: loop that:
actionExpected Output:
What do you want to do? (buy/sell/quit):
Inside the loop, add:
if action == "buy":
items_bought by 1Expected Output (Success):
What item do you want to buy? Valkyrie Helm
You bought Valkyrie Helm for 25000 Robux!
You now have 5000 Robux
Your Inventory: {'Valkyrie Helm': 25000}
Items Bought: 1
Expected Output (Not Enough Robux):
What item do you want to buy? Dominus
Not enough Robux! Dominus costs 50000 Robux
Expected Output (Item Doesn't Exist):
What item do you want to buy? Ninja Sword
Item not found in catalog!
Inside the loop, add:
elif action == "sell":
delitems_sold by 1Expected Output (Success):
What item do you want to sell? Bloxy Cola
You sold Bloxy Cola for 250 Robux!
You now have 4750 Robux
Your Inventory: {'Valkyrie Helm': 25000}
Items Sold: 1
Expected Output (Item Not in Inventory):
What item do you want to sell? Rainbow Wings
You don't own that item!
Inside the loop, add:
elif action == "quit":
break to exit the loopExpected Output:
Final Robux: 4750
Final Inventory: {'Valkyrie Helm': 25000}
Total Items Bought: 2
Total Items Sold: 1
Thanks for shopping!
Add an else: statement:
Expected Output:
What do you want to do? (buy/sell/quit): trade
Invalid action! Please type buy, sell, or quit
How much Robux do you have? 30000
=== ROBLOX CATALOG SHOP ===
Dominus: 50000 Robux
Sparkle Time Fedora: 15000 Robux
Valkyrie Helm: 25000 Robux
Rainbow Wings: 8000 Robux
Golden Crown: 12000 Robux
Bloxy Cola: 500 Robux
Your Robux: 30000
Your Inventory: {}
Items Bought: 0
Items Sold: 0
What do you want to do? (buy/sell/quit): buy
What item do you want to buy? Valkyrie Helm
You bought Valkyrie Helm for 25000 Robux!
You now have 5000 Robux
Your Inventory: {'Valkyrie Helm': 25000}
Items Bought: 1
What do you want to do? (buy/sell/quit): buy
What item do you want to buy? Bloxy Cola
You bought Bloxy Cola for 500 Robux!
You now have 4500 Robux
Your Inventory: {'Valkyrie Helm': 25000, 'Bloxy Cola': 500}
Items Bought: 2
What do you want to do? (buy/sell/quit): sell
What item do you want to sell? Bloxy Cola
You sold Bloxy Cola for 250 Robux!
You now have 4750 Robux
Your Inventory: {'Valkyrie Helm': 25000}
Items Sold: 1
What do you want to do? (buy/sell/quit): buy
What item do you want to buy? Dominus
Not enough Robux! Dominus costs 50000 Robux
What do you want to do? (buy/sell/quit): trade
Invalid action! Please type buy, sell, or quit
What do you want to do? (buy/sell/quit): quit
Final Robux: 4750
Final Inventory: {'Valkyrie Helm': 25000}
Total Items Bought: 2
Total Items Sold: 1
Thanks for shopping!
while True: for infinite loopbreak to exit the loopcatalog[item]inventory[item] = pricedel inventory[item]if item in catalog:price // 2items_bought += 1โ Standard library: heapq, collections, itertools, math, random, functools, datetime, bisect
โ Functions, classes, recursion, print()
โ No file system, subprocess, OS access, or network requests
โ No pip install (all supported modules are pre-loaded)
โฑ๏ธ 5 second execution time limit