【发布时间】:2016-09-09 06:39:38
【问题描述】:
x = []
y = int(input("Hello, please enter your date of birth in this format: DDMMYYYY"))
x.append(y)
b = len.x()
if b > 7:
input("Please enter your date of birth correctly in the above format")
elif b < 7:
input("Please enter your date of birth correctly in the above format")
目前我收到此错误:
b = len.x()
AttributeError: 'builtin_function_or_method' 对象没有 属性'x'
对不起,我对python很陌生,谢谢大家的帮助!
【问题讨论】:
-
你为什么尝试
len.x()?!您是否考虑过阅读 Python 的文档,而不仅仅是随机猜测? -
有点奇怪但是:len(str(y))
-
不要将您的问题编辑为正确的语法。保持原样,如果你愿意,回答你自己的问题。不要修改原始问题以获得正确的语法。
标签: python python-3.x