作为一个有趣的项目,我将我的医学知识和学习结合起来。我的目标是制作一个算法,在给定输入提示的情况下,将吐出正确的心律。代码运行良好,直到我试图打印出来" SVT"。 " qrswidth"给了我" V-TACH!"无论输入如何。
代码就在这里以防万一无法解读:http://pastebin.com/dJDM5zTG
总的noob问题,但我正在为我的护理人员板上学习,我认为这将是练习这个和Python的精彩世界的好方法。事实证明这是一个让人头疼的好方法。
非常感谢提前。
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print("________________________________________________________ ")
#regularity, pr, qr, st, and arate are inactive for future development
'''regularity = input("Is it regular? ")
pr = input("What is the pr length? ")
qr = input("How wide is the QRS? ")
st = input("Is there ST elevation? ")
arate = input("What is the atrial rate? ")'''
vrate = input("What is the ventricular rate? ")
def asystole():
if vrate == '0':
print(" ----------YOUR RESULTS HERE--------- ")
print(" Asystole!")
print(" ------------------------------------ ")
else:
vtach()
def vtach():
if vrate >= '160':
qrswidth = input("Is the QRS wide or narrow? ")
if qrswidth == "wide" or "Wide" or "WIDE" or "wIDE":
print("V-TACH!")
elif qrswidth == "narrow" or "nARROW" or "NARROW" or "nARROW":
print("SVT!")
else:
print("done")
"""
elif qrswidth == "narrow" or "nARROW" or "NARROW" or "nARROW":
print("SVT!")
else:
print("moving along")
"""
print(" ")
print(" ")
print(" ----------YOUR RESULTS HERE--------- ")
asystole()
print(" ------------------------------------- ")
print(" ")
print(" ")