gpt4 book ai didi

python - 哪个标记在此箭头调用中无效?

转载 作者:太空宇宙 更新时间:2023-11-03 11:01:57 27 4
gpt4 key购买 nike

以下代码失败

In [1]: import arrow

In [2]: arrow.get(2015, 06, 08, 23, 59)
File "<ipython-input-2-44d7fca57336>", line 1
arrow.get(2015, 06, 08, 23, 59)
^
SyntaxError: invalid token

为什么这个初始化per the arrow docs返回错误?

最佳答案

在文字数字前面放一个零使其成为八进制。参见 What do numbers starting with 0 mean in python? .

八进制数只能包含数字 07

08 不是有效的八进制数。

这与arrow无关.您链接的示例不使用八进制数。

关于python - 哪个标记在此箭头调用中无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30731548/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com