Jul-17-2021, 02:12 AM
Hello
please help me
Condition 1 (if the result is between 3 and 5)
Condition 2 (and has been in contact with an infected person),
print(he/she must
Self-isolate for 14 days and get tested for covid-19.)
Condition 1 The problem in condition 2 is not fulfilled, meaning if a vertex by entering 0 is met, all conditions are not fulfilled, even if a vertex is entered by 1 all the conditions are met.
-----------------------------------------------------------------------------
please help me
Condition 1 (if the result is between 3 and 5)
Condition 2 (and has been in contact with an infected person),
print(he/she must
Self-isolate for 14 days and get tested for covid-19.)
Condition 1 The problem in condition 2 is not fulfilled, meaning if a vertex by entering 0 is met, all conditions are not fulfilled, even if a vertex is entered by 1 all the conditions are met.
-----------------------------------------------------------------------------
a = input("name:") y = input("Age:") z = input("Sex:") x = open("c19.txt", "w") print("**Notice 1 mean yes, 0 mean no.** ") def sum(Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9): q = (Q1 + Q2 + Q3 + Q4 + Q5 + Q6 + Q7 + Q8 + Q9) if (q >= 3) or (q <= 5) and (Q1 == 1): # Highligted in red x = open("c19.txt", "w") x.write("name: " + a + "\n" + "Age: " + y + "\n""Sex: " + z + "\n") x.write("Result:\t"+"he/she must isolate him/her self for 14 days and do covid-19 test.") x.close() elif q > 5: x = open("c19.txt", "w") x.write("name: " + a + "\n" + "Age: " + y + "\n""Sex: " + z + "\n") x.write("Result:\t"+"he/she must do covid-19 test, Mybe he/she infected by covid-19.") x.close() elif q < 3: x = open("c19.txt", "w") x.write("name: " + a + "\n" + "Age: " + y + "\n""Sex: " + z + "\n") x.write("Result:\t"+"he/she must isolate him/her self for 5 days if no more symptoms show,then he/she are not infected.") x.close() n3 = (int)(input("if was in contact with an infected person:")) n4 = (int)(input("Do you have a fever:")) n5 = (int)(input("Do you have a cough:")) n6 = (int)(input("Do you have shortness of breath or difficulty breathing:")) n7 = (int)(input("Do you have Fatigue:")) n8 = (int)(input("Do you have muscle or body aches:")) n9 = (int)(input("Do you have a headache:")) n10 = (int)(input("Do you have a loss of taste or smell:")) n11 = (int)(input("Do you have a sore throat:")) sum(n3, n4, n5, n6, n7, n8, n9, n10, n11)