Skip to content

semencotan/florist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

florist

class Flower: def init(self, name, color, price): self.name = name self.color = color self.price = price self.quantity

class Florist: def init(self): self.inventory = []

def add_flower(self, flower):
    self.inventory.append(flower)

def display_inventory(self):
    print("Florist Inventory:")
    for flower in self.inventory:
        print(f"Name: {flower.name}, Color: {flower.color}, Price: ${flower.price}")

def main(): florist = Florist()

# Adding some flowers to the inventory
rose = Flower("Rose", "Red", 10)
tulip = Flower("Tulip", "Yellow", 8)
lily = Flower("Lily", "White", 12)

florist.add_flower(rose)
florist.add_flower(tulip)
florist.add_flower(lily)

# Displaying the inventory
florist.display_inventory()

if name == "main": main()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published