def failure():
print("Unfortunately there is no solution for your device.")
case_n = file = open("File Numbers.txt", "r")
case_number = case_n + 1
file.close()
file=open("Case " + str(case_number) + ".txt" , "w")
file.close()
def solution():
file = open(phone_folder)
ans = file.read()
file.close()
print(ans)
import os.path
phone=input("What make is your phone?")
phone_folder = (phone + ".txt")
if os.path.isfile(phone_folder):
solution()
else:
failure()
input()
我想创建一个每次都有不同编号的文本文件。并在其中写下手机的名称。