我目前正在构建一个小python脚本,由于某种原因,我在输入值之后收到了一个无效的令牌。在
代码:
#!/usr/bin/python
def main():
frankOceanRelease()
def frankOceanRelease():
info = str(input('Enter the date in which Frank will drop his album (MM/DD/YYYY):')).split("/")
if info[1] == "13" and info[0] == "11":
return('Let\'s hope he doesn\'t flake')
elif info[2] == "3005":
return('This might happen, but no guarantee')
else:
return('Nah man, this album ain\'t out yet!')
if __name__ == "__main__":
main()
错误:
^{pr2}$
如果您在Python 2上,那么输入用^{{cd2>}(即^{{cd3>})分隔的项目将执行多个整数分区。你几乎总是会得到一个^{cd4>}因为这一年将远远大于另外两个。
另一方面,如果不使用分隔符输入,将引发您看到的错误,因为无法评估该输入。
您想要的是^{cd5>}:
相关问题 更多 >
编程相关推荐