我试图将“房间”中的值作为键,将“acquity”作为字典的值,或者每次代码运行时都将最终值“acquity”分配给一个新变量(它需要运行 32 32 个房间的时间)。我无法弄清楚这一点,对不起,对此很陌生,任何帮助将不胜感激。
def main():
var=0
while (var<33):
room=raw_input("Input patient room Number ")
##Lists and prints/input for Procedural acuity
print "1- No Procedures"
print "2- IV Starts, Foley Catheter"
print "3- Vitals, Neuro Check, Bladder Scans"
print "4- Bedside Procedure, Physician post-op, frequent catheterization"
a=raw_input("Input Procedural Acuity 1-4 ")
##Lists and prints/input for Nutritional acuity
print "1- Setup Self"
print "2- Ordering Assistance"
print "3- Feed"
print "4- Tubefeed, Aspiration Procedures"
b=raw_input("Input Nutritional Acuity 1-4 ")
##Lists and prints/input for Medication acuity
print "1- Minimal Oral"
print "2- Moderate PO/IV"
print "3- Dysphasia/Multi IV"
print "4- Chemo/GTUBE/Complex IV"
c=raw_input("Input Medication Acuity 1-4 ")
##Lists and prints/input for Mobility acuity
print "1- Ad lib"
print "2- Assist of SB"
print "3- Assist of 1"
print "4- Assist of 2"
d=raw_input("Input Mobility Acuity 1-4 ")
##Lists and prints/inputs for Behavioral Acuity
print "1- Calls Appropriately/No Needs"
print "2- Some Education/ Calls Often"
print "3- Anxious/ Calls Frequently"
print "4- New Diagnosis, Calls very frequently, highly anxious"
e=raw_input("Input Behavioral Acuity 1-4 ")
a=float(a)
b=float(b)
c=float(c)
d=float(d)
e=float(e)
Acuity1= a+b+c+d+e
print "Patient in room %s, is graded at acuity %s"%(room, Acuity1)
var= var + 1
if __name__ == '__main__':
main()