# Disease Information Dictionary diseases = { "flu": { "symptoms": ["fever", "cough", "sore throat", "body aches", "fatigue"], "treatment": "Rest, fluids, pain relievers, and anti-viral medications if prescribed." }, "headache": { "symptoms": ["head pain", "nausea", "sensitivity to light"], "treatment": "Rest, hydration, over-the-counter painkillers, and avoid triggers." }, "diabetes": { "symptoms": ["increased thirst", "frequent urination", "fatigue", "blurred vision"], "treatment": "Insulin therapy, lifestyle changes, and dietary management." }, "cold": { "symptoms": ["sore throat", "runny nose", "cough", "sneezing", "mild body aches"], "treatment": "Rest, hydration, decongestants, and over-the-counter pain relief." }, "asthma": { "symptoms": ["shortness of breath", "wheezing", "chest tightness", "coughing"], "treatment": "Inhalers, bronchodilators, corticosteroids, and avoiding triggers." }, "pneumonia": { "symptoms": ["cough with mucus", "fever", "shortness of breath", "chest pain"], "treatment": "Antibiotics for bacterial pneumonia, rest, fluids, and pain relievers." } # Add more diseases here if needed } # Function to display disease information def display_disease_info(disease_name): disease_name = disease_name.lower() if disease_name in diseases: disease = diseases[disease_name] print(f"\nDisease: {disease_name.title()}") print("Symptoms:") for symptom in disease["symptoms"]: print(f" - {symptom}") print(f"\nTreatment: {disease['treatment']}") else: print("Disease not found. Please check the name and try again.") # Function to handle chat feature def chat_bot(): print("\nChat Bot is active. Type 'exit' to quit.\n") while True: user_input = input("You: ").strip().lower() # Responding to the "cha hal aa?" query with "khair aa" if user_input == "cha hal aa?": print("Bot: khair aa") # Check if the user wants to know about a disease elif user_input in diseases: display_disease_info(user_input) # Exit the chat bot if the user types 'exit' elif user_input == "exit": print("Exiting chat...") break # If the input is unrecognized else: print("Bot: Sorry, I didn't understand that. Please ask about a disease or type 'exit' to quit.") # Main menu to choose between disease info or chat def main(): print("Welcome to the Disease Information and Chat Bot!\n") while True: print("\nChoose an option:") print("1. Disease Information") print("2. Chat with Bot") print("3. Exit") option = input("Enter your choice (1/2/3): ").strip() if option == "1": disease_name = input("Enter the name of the disease: ").strip().lower() display_disease_info(disease_name) elif option == "2": chat_bot() elif option == "3": print("Exiting the program...") break else: print("Invalid choice. Please try again.") # Run the program if __name__ == "__main__": main()