Python这个代码错在哪?
importjsonfilename='username.json'try:withopen(filename)asf_obj:username=json.load(f_...
import jsonfilename = 'username.json'try: with open(filename)as f_obj: username = json.load(f_obj)except FileNotFoundError: username = input("what's your name?:") with open(filename,'w')as f_obj: json.dump(username,f_obj) print("We'll remember you when you comeback, "+username+"!")else: print("Welcome back, "+username +' !')明明书上说是可以运行的代码 但是却返回了一大串的错误代码
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询