You are on page 1of 4

Main.

py :

class Restaurant :

def __init__(self , name , type ) :


self.name = name
self.type = type
self.is_open = False
self.customer_number = 0

def info(self):
print(f"this is {self.name} resturant and we are a {self.type} restaurant :)")
print("Customer Count:", self.customer_number )

def set_customer_count(self, count):


self.customer_number = count

def add_customer(self , num ) :


self.customer_number += num

def open_close(self , status ) :


if status == "open" :
self.is_open = True
print("The restaurant is open and the food is ready.")
elif status =="close" :
self.is_open = False
print("The restaurant is closed.")

restaurant = Restaurant("sajad ketring" , "fast food ")


restaurant.info()
restaurant.open_close("open")
restaurant.customer_number = 20
restaurant.set_customer_count(5)
print(restaurant.customer_number)
restaurant.add_customer(20)
print(restaurant.customer_number)
class CoffeeShop(Restaurant) :

def __init__(self , name , type , ice_cream_type ) :


self.name = name
self.type = type
super().__init__(name , type )
self.ice_cream_type = ice_cream_type

def print_ice_cream_type(self):
print("Ice Cream Type:", self.ice_cream_type)

coffeshop = CoffeeShop("Creamy Delights", "Coffee Shop", "Vanilla")

# -------------------------------------------------------------------

import random
from random import randint

shape_1 = """
-----
| |
|o|
| |
-----
"""

shape_2 = """
-----
|o |
| |
| o|
-----
"""

shape_3 = """

-----
|o |
|o|
| o|
-----
"""
shape_4 ="""
-----
|o o|
| |
|o o|
-----
"""
shape_5 ="""
-----
|o o|
|o|
|o o|
-----
"""
shape_6 ="""
-----
|o o|
|o o|
|o o|
-----
"""

dice = random.randint(1,6)
if dice == 1 :
print(shape_1)

if dice == 2 :
print(shape_2)

if dice == 3 :
print(shape_3)

if dice == 4 :
print(shape_4)

if dice == 5 :
print(shape_5)

if dice == 6 :
print(shape_6)

car = ["honda" , "mecedes" , "tesla", "lambo "]


car_random = random.randint( 0 , len(car) )
print(car[car_random])

You might also like