[Python] I need help writing and finishing a program that describes a covid19 flowchart. I need 4 parts, specfically If I was in contact with someone else that was sick, taking the covid test, inputting the covid test (positive/negative), and attending school with risk of covid. Here's my code so far: while(True):     # condition 1     val1 = input("\nAny COVID symptoms (a high body temperature, new continuous cough, lost taste or lost sense of smell)?\n").lower()     if(val1=="yes"):         # condition 2         val2 = input("\nTake a COVID test. What is the result?\n").lower()         if(val2=="positive"):             print("\nStay at home for 14 days\n")             # continue is used to again ask the same questions             continue         elif(val2=="negative"):             continue     # condition 3     elif(val1=="no"):         # if student is fine than just break the loop         print("\nGo to school")         break

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 7E
icon
Related questions
Question

[Python] I need help writing and finishing a program that describes a covid19 flowchart. I need 4 parts, specfically If I was in contact with someone else that was sick, taking the covid test, inputting the covid test (positive/negative), and attending school with risk of covid.

Here's my code so far:


while(True):
    # condition 1
    val1 = input("\nAny COVID symptoms (a high body temperature, new continuous cough, lost taste or lost sense of smell)?\n").lower()
    if(val1=="yes"):
        # condition 2
        val2 = input("\nTake a COVID test. What is the result?\n").lower()
        if(val2=="positive"):
            print("\nStay at home for 14 days\n")
            # continue is used to again ask the same questions
            continue
        elif(val2=="negative"):
            continue
    # condition 3
    elif(val1=="no"):
        # if student is fine than just break the loop
        print("\nGo to school")
        break

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

I need help making my python code to set up 4 variables like a flowchart for each option, using proper if/elif/else statements, and reformatting with f-strings to say how long should I stay home or test cases I should have.

4 variables: Had close contact with someone else sick, have a test, positive/negative, and should you attend school with sickness.

My code so far:



while(True):
    print("\nWelcome to the COVID-19 Flowchart.")
    print("Please answer the following questions to determine your course of action.")

    val1 = input("\nDo you have any COVID symptoms (a high body temperature, new continuous cough, lost taste, or lost sense of smell)?\n").lower()

    if val1 == "yes":
        val2 = input("\nTake a COVID test. What is the result? (Positive/Negative)\n").lower()
        if val2 == "positive":
            print("\nYou tested positive for COVID-19. Please stay at home for 14 days.")
            break
        elif val2 == "negative":
            continue
    elif val1 == "no":
        print("\nYou don't have any COVID symptoms. You can attend school.")
        break

print("\nThank you for using the COVID-19 Flowchart. Stay safe!")

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr