1

As a fun project I'm combining my medical knowlege and learning to program. My goal is to make an algorithm that, given input prompts, will spit out the correct cardiac rhythm. The code works well up until I try to get it to print out "SVT". "qrswidth" is giving me "V-TACH!" regardless of the input.

The code is here just in case it's hard to read unformated: http://pastebin.com/dJDM5zTG

Total noob question but I'm studying for my paramedic boards and I thought this would be a good way to practice that and the wonderful world of Python. Turns out it's a good way to get a headache.

Many thanks in advance.

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(" ")

0 Answers0