hywelcode 2022-07-22 14:30 采纳率: 50%
浏览 69

IndentationError: unexpected indent

python
import saved as s
try:
    print(s.read("t.ttt"))
except:
    while True:
      a = input("language(china/english:)")
        if a == "china" or a == "China" or a == "CHINA":
            s.write("t.ttt")
            s.write("china.cn")
            break
        elif a == "english" or a == "English" or a == "ENGLISH":
            s.write("t.ttt")
            s.write("eng.cn")
            break
        else:
            print("Re-enter")
try:
    s.read("china.cn")
    try:
        print(s.read("w.china"))    
    except:
        y = input("邮箱:")
        m = input("密码:")
        s.write("w.china", "邮箱:"+y+"\t"+"密码:"+m)
except:
    s.read("eng.cn")
    try:
        print(s.read("w.eng"))
    except:
        y = input("mail:")
        m = input("password:")
        s.write("w.eng", "mail:"+y+"\t"+"password:"+m)

saved.py:

  def write(file,text):
    w=open(file,"w")
    w.write(text)
def read(file):
    r=open(file,"r")
    return r.read()
运行结果:
  File "C:\Users\Public\TurtleWorkspace\elwhy\main.py", line 7
    if a == "china" or a == "China" or a == "CHINA":
    ^
IndentationError: unexpected indent

我看了没有缩进啊,这是怎么回事啊!
  • 写回答

1条回答 默认 最新

  • 快乐小土狗 2022-07-22 14:35
    关注

    img

    评论

报告相同问题?

问题事件

  • 创建了问题 7月22日

悬赏问题

  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Linux权限管理相关操作(求解答)
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表
  • ¥15 DbVisualizer Pro 12.0.7 sql commander光标错位 显示位置与实际不符
  • ¥15 android 打包报错
  • ¥15 关于stm32的问题
  • ¥15 ncode振动疲劳分析中,noisefloor如何影响PSD函数?