我是 python 新手。我正在尝试制作一个小型电梯程序。
编码:
import time
elavator = True
# 0 is B floor // basement
elavatorFloors = [0,1,2,3,4,5]
while elavator == True:
getLevel = input ("Which floor would you like to visit? ( 1 - 5) ")
time.sleep(2)
print "you're now at floor, " +int.getLevel
我收到此错误: AttributeError: type object 'int' has no attribute 'getLevel' 除了将 str 更改为 int,我是否使用了任何不好的技术?我真的很想提高我的编程思维和代码编写能力。谢谢 :)