Else Syntax Error Python

后端 未结 6 1933
心在旅途
心在旅途 2020-12-07 06:27
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 l         


        
6条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 07:14

    Your log_f.write statement is also missing a trailing ')', which is likely confusing the parser...and the indentation doesn't look right. Cut and paste problem?

提交回复
热议问题