小编use*_*549的帖子

其他语法错误Python

if len(user_hash) > 0:
  with open(log_file, "w") as log_f:
    for name in user_hash:
        log_f.write("Name:%s \n Email: %s" % (name, email)

    else len(user_hash) < 0:
       print "Nothing happened :("
Run Code Online (Sandbox Code Playgroud)

我一直在else语句中遇到语法错误,我不确定为什么它会一直产生这个错误.我在同一个def中没有任何其他语句,但仍然会出错.我该怎么办?

python if-statement

-1
推荐指数
2
解决办法
2万
查看次数

标签 统计

if-statement ×1

python ×1