Python3-什么是正确的语法? a = b(字符串,整数)

时间:2019-06-10 05:19:06

标签: string integer

我已经连续学习了30个小时,可能应该休息了,但是我想完成这一点。我做错了什么?

构造器

def __init__(self, street_address, city, state, zipcode, bedrooms, bathrooms, squarefeet, modelname, salestatus):
    self.street_address = street_address
    self.city = city
    self.state = state
    self.zipcode = zipcode
    self.bedrooms = bedrooms
    self.bathrooms = bathrooms
    self.squarefeet = squarefeet + 'square feet'
    self.modelname = modelname
    self.salestatus = salestatus

1。添加首页

def add_home(self):
    street_address = input('Enter street address: ')
    city = input('Enter city: ')
    state = input('Enter state: ')
    zipcode = int(input('Enter zip code: '))
    bedrooms = int(input('Enter number of bedrooms: '))
    bathrooms = int(input('Enter number of baths: '))
    squarefeet = int(input('Enter square footage: '))
    modelname = input('What is the model?: ')
    salestatus = input('Is the home sold, available, or under contract?: ')

    home_info = Home_Inventory(street_address, city, state, int(zipcode), int(bedrooms), int(bathrooms), int(squarefeet) + ' square feet', modelname, salestatus)
    full_address = (street_address, city, state, int(zipcode)
    home_stats = (int(bedrooms), int(bathrooms), int(squarefeet) + ' square feet', modelname, salestatus)
    Allhomes = {full_address: home_stats}

    print('Home has been added successfully.')

0 个答案:

没有答案