Class ShoppingCart
Class ShoppingCart
"""
A class to represent a shopping cart.
Attributes:
items (dict): A dictionary where the keys are item names and the values are
their prices.
Methods:
add_item(item, price): Adds an item and its price to the cart.
remove_item(item): Removes an item from the cart.
get_total(): Calculates and returns the total price of all items.
show_cart(): Prints the items in the cart with their prices.
"""
def __init__(self):
"""Initializes the ShoppingCart class with an empty cart."""
self.items = {}
Parameters:
item (str): The name of the item.
price (float): The price of the item.
"""
self.items[item] = price
def remove_item(self, item):
"""
Removes an item from the cart.
Parameters:
item (str): The nam