<jupyter_start><jupyter_text>AirBnb Project```Airbnb, Inc. is an American company that operates an online marketplace for lodging, primarily homestays for vacation rentals, and tourism activities. ```<jupyter_code>from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
from IPython.display import display
import ipywidgets as widgets

from matplotlib import pyplot as plt
# Define Variables
roomPrice = 100
roomCount = 1
aviableDays = 30
occupanyRate = 0.6

cleaningFee = 50
unitBill = 5

#Fixed Cost
rent = 2500
maintainance = 500

contributionMargin = 100
try:
    roomPriceUI = widgets.IntSlider(
        value=100,
        min=0,
        max=500,
        step=1,
        description='Room Price:',
        disabled=False,
        continuous_update=True,
        orientation='horizontal',
        readout=True,
        readout_format='d')
    display(roomPriceUI)

    roomCountUI = widgets.IntSlider(
        value=2,
        min=0,
        max=50,
        step=1,
        description='Room Count:',
        disabled=False,
        continuous_update=True,
        orientation='horizontal',
        readout=True,
        readout_format='d')
    display(roomCountUI)

    availableDayUI = widgets.IntSlider(
        value=2,
        min=0,
        max=30,
        step=1,
        description='Available:',
        disabled=False,
        continuous_update=True,
        orientation='horizontal',
        readout=True,
        readout_format='d')
    display(availableDayUI)

    occupanyUI = widgets.FloatSlider(
        value=0.6,
        min=0,
        max=1,
        step=0.01,
        description='Occup (%):',
        disabled=False,
        continuous_update=True,
        orientation='horizontal',
        readout=True,
        readout_format='.2f')
    display(occupanyUI)
except:
    print("Please Download the necessity libraries")
def calculateRevenue (roomPrice, roomCount, aviableDays, occupanyRate):
    revenue = roomPrice * roomCount * aviableDays * occupanyRate
    return revenue
    
def calculateVariableCost (roomCount, aviableDays, occupanyRate, cleaningFee, unitBill):
    variableCost = roomCount * aviableDays * occupanyRate *  (cleaningFee + unitBill)
    return variableCost

def calculateUnitCost (cleaningFee, unitBill):
    unitCost = (cleaningFee + unitBill)
    return unitCost

def calculateContributionMargin(price,unitCost):
    return price - unitCost
    
def calculateFixedCost (rent, maintainance):
    return rent+maintainance

def calculateProfit(c1, c2, c3):
    return c1 - c2 - c3

def calculateBreakEvenPoint(c1, c2, c3):
    try:
        return c3/(c1-c2) #fixed cost/(unit revenue - unit variable cost) & ours is calculated based on 1 month
    except ZeroDivisionError:
        print("Break even is undefined!!")
        return 0.00

def report(revenue,varCost,fixCost,profit,breakEven):
    breakEvenStr = "{:.2f}".format(breakEven)
    print(f"Revenue: {revenue} tl")
    print(f"Variable Cost: {varCost} tl")
    print(f"Ficed Cost: {fixCost} tl")
    print(f"Profit: {profit} tl")
    print(f"BreakEven Point: {breakEvenStr} months")
    


def updateVariables():
    roomPrice    = roomPriceUI.value
    roomCount    = roomCountUI.value
    aviableDays  = availableDayUI.value
    occupanyRate = occupanyUI.value
    varCost = calculateUnitCost(cleaningFee, unitBill)
    contributionMargin = calculateContributionMargin(roomPrice,varCost)

def main():
    updateVariables()
    rev = calculateRevenue(roomPrice, roomCount, aviableDays, occupanyRate)
    varCost = calculateVariableCost (roomCount, aviableDays, occupanyRate, cleaningFee, unitBill)
    fixCost = calculateFixedCost (rent, maintainance)
    prof = calculateProfit (rev, varCost,fixCost)
    breakEven = calculateBreakEvenPoint (rev,varCost, fixCost)
    report(rev,varCost,fixCost,prof,breakEven)
    

    
main()

def breakEvenGraph(CM,fixedCost):

    CM_list = [(fixedCost * -1)]
    for day in range(1,30):
        CM_list.append(CM_list[day-1] + CM)
    
    plt.figure(figsize=(15,6))
    plt.plot(CM_list)
    
    plt.title("A-MEAN AirBnB Break Even Analysis")
    plt.xlabel("Days")
    plt.ylabel("Dollar($)")

    plt.show()

    
breakEvenGraph(contributionMargin,fixCost)
saveReport()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09765170890490583, 'fraction_numerical': 0.016740292955126714, 'mean_word_length': 3.336693548387097, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '93131', 'license': 'Apache-2.0', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1329, 'n_words': 303, 'path': 'AirBnbProject/AirBnbAnalysis.ipynb', 'repo_name': 'eminkartci/PythonCourse', 'size': '4301'}