2024-05-13 12:17:17 发布
网友
我可以做smth,比如:
if maxoksum > 0: R = maxoksum
但如果我尝试类似的事情,比如:
if oksum % 3 == 0: if oksum > maxoksum: maxoksum = oksum
我得到SyntaxError:
if oksum % 3 == 0: if oksum > maxoksum: maxoksum = oksum ^ SyntaxError: invalid syntax
我做错了什么?如果在同一条线上,有没有办法开始工作
回答我的问题,因为我无法将评论标记为解决方案。引用@deceze的评论:
Arguably an if..: if..: .. could work, but if..: foo if..: bar or if..: if..: .. else: are already syntactically impossible to disambiguate, so it’s simply not possible to write any such compound block statement.
if..: if..: ..
if..: foo if..: bar
if..: if..: .. else:
回答我的问题,因为我无法将评论标记为解决方案。引用@deceze的评论:
相关问题 更多 >
编程相关推荐