在標題爲#標題類型和大小的部分,我想打印出每個瓷磚的定價,但我不能劃分數字。我將如何解決這個問題?由於如何解決無效的語法
print("Welcome to Terry Cotta's Tiling Company!")
#Dimenstion of area to be tiled
areaLength = int(input('Input length of area to be tiled in metres: '))
if areaLength <= 0:
print('Area cannot be lower than 0')
areaLength = int(input('Input length of area to be tiled in metres: '))
areaWidth = int(input('Input width of area to be tiled: '))
if areaWidth <= 0:
print('Area cannot be lower than 0')
areaWidth = int(input('Input length of area to be tiled in metres: '))
areaArea = areaLength*areaWidth
#Tile type and size
tiles = {'ceramic': '3', 'granite': '5', 'marble': '10'}
for x in tiles:
print(x.title() + " - Small: $" + int(tiles[x])/2 + " Medium: $" + tiles[x] + " Large: $" + int(tiles[x])*(2)
tileType = input("What type of tile would you like? Ceramic, granite or marble?: ")
tileType = tileType.lower()
while tileSuitable != 'yes':
if tileType not in tiles:
print('We do not provide that type of tile. Please enter again.')
tileType = input("What type of tile would you like? Ceramic, granite or marble?: ")
if tileType in tiles:
tileSize = input('What size tile would you like? Small, medium or large: ')
# else:
# print(tileType.title() + ' costs $' + tiles[tileType])
# confirmTileType = input('Is this your desired material? ')
# confirmTileType = confirmTileType.lower()
# if confirmTileType == 'no':
# tileType = input("What type of tile would you like? Ceramic, granite or marble. Type 'cost' for cost of materials: ")
複製並粘貼您的錯誤在這裏。 – wolendranh
它只是說'無效語法' – Lazlt
只是試圖評論一些代碼,您可能會發現錯誤的正確位置。簡單地將所有代碼粘貼到這裏並要求其他人檢查 – linpingta