[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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education