Python 根据过去的天数更新数据文件,并在每次单击Enter时减少患者的剩余天数

Python 根据过去的天数更新数据文件,并在每次单击Enter时减少患者的剩余天数,python,list,count,Python,List,Count,我正在编写一个代码,其中列出了一家医院的性别和康复天数 当满足患者的天数时,他们将出院,性别将从男/女变为“.”。与患者相连的日子也将随之消失 下面是一些患者的样本以及其格式 F 28 F 18 F 5 F 22 M 16 只有30天,这是我到目前为止的代码 infile = open("Data.txt", "r") record = infile.readline() count = 0 while count <= 30:

我正在编写一个代码,其中列出了一家医院的性别和康复天数

当满足患者的天数时,他们将出院,性别将从男/女变为“.”。与患者相连的日子也将随之消失

下面是一些患者的样本以及其格式

F 28 F 18 F 5 F 22 M 16

只有30天,这是我到目前为止的代码

 infile = open("Data.txt", "r")
 record = infile.readline()

 count = 0
 while count <= 30:
     password = input("Press Enter to Advance One Day")
     if password == "":
         count += 1
         while (record!= ""):
             sex = infile.readline()
             recuperationTime = infile.readline()
             print(sex, recuperationTime)
     else:
         print("Please press enter")
infle=open(“Data.txt”、“r”)
record=infle.readline()
计数=0
而计数