A Python Program To Check The Risk Of Corona Virus. - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › A Python Program To Check The Risk Of Corona Virus. (2375 Views)
| A Python Program To Check The Risk Of Corona Virus. by Kubernetes(op): 7:22pm On Mar 10, 2020 |
Are you a python programmer? Estimate your risk of CoVid-19 with few questions. Try out the below python code. Save with covid19.py Respond to the questions when prompted. name = input('name: ') age = int(input('age: ')) print('\ndo you have any of these symptoms?') fever = int(input('fever (0= no, 1= yes): ')) cough = int(input('cough (0= no, 1= yes): ')) sob = int(input('shortness of breath (0= no, 1= yes): ')) sore = int(input('sore throat or runny nose (0= no, 1= yes): ')) vomit = int(input('vomiting (0= no, 1= yes): ')) ill = int(input('diabetes, kidney, or heart disease (0= no, 1= yes): ')) epi = int(input('have you been in epidemic region, or in contact with person from that region in last 14 days (0= no, 1= yes): ')) risk = fever*2 + cough*2 + sob*2 + sore + vomit + ill print('\nok, dear', name) if epi ==0: if risk > 4: print("you don't have high risk of COVID 19, it's probably flu," ![]() else: print("you have how risk of COVID 19 infection," ![]() if epi ==1: if risk > 4: print('you have risk of infection, you should wear surgical mask and be isolated until make the test') else: print("you don't have COVID 19 sign, but may you have risk because of epidemic region, " ![]() if -1<age<41: rate = "0.2 %" if 40<age<51: rate = "0.4 %" if 50<age<61: rate = '1.3 %' if 60<age<71: rate = "3.6 %" if 70<age<81: rate = '8 %' if 80<age: rate = '14.8 %' print('according to your age, if you have infected, the fatality rate is:', rate)
|
| Re: A Python Program To Check The Risk Of Corona Virus. by kayode69(m): 8:10pm On Mar 10, 2020 |
Wow! Keep it up bro |
| Re: A Python Program To Check The Risk Of Corona Virus. by Venzee(m): 9:12pm On Mar 10, 2020 |
Kubernetes:Original tramadol extra na watin dey high you |
| Re: A Python Program To Check The Risk Of Corona Virus. by Kubernetes(op): 9:17pm On Mar 10, 2020 |
Venzee:Thanks. Not your fault. Allow those that who knows run it |
| Re: A Python Program To Check The Risk Of Corona Virus. by LoveElfrida(m): 9:46pm On Mar 10, 2020 |
Nice share, next time reference the original author. Good to know that you code on a mobile too. |
| Re: A Python Program To Check The Risk Of Corona Virus. by Nobody: 11:58pm On Mar 11, 2020*. Modified: 12:18am On Mar 12, 2020 |
Kubernetes:Great job, more grease to your elbow. Although correct the bolded to low |
| Re: A Python Program To Check The Risk Of Corona Virus. by devkolya: 4:49pm On Mar 12, 2020 |
Good but eeerm... would love to see a clean code probably in classes ![]() |
| Re: A Python Program To Check The Risk Of Corona Virus. by Dthinkerman: 7:29pm On Mar 12, 2020 |
LoveElfrida:Could you kindly let us know the mobile editor? |
| Re: A Python Program To Check The Risk Of Corona Virus. by trytillmake(m): 11:48am On Mar 13, 2020 |
nice work bro, this can actually be used in developing an app |
| Re: A Python Program To Check The Risk Of Corona Virus. by Abcruz(m): 6:51pm On Mar 13, 2020 |
Nice work |
| Re: A Python Program To Check The Risk Of Corona Virus. by noob03saibot(m): 3:41am On Mar 14, 2020 |
Want to ask, in the risk variable, why were you multiplying fever, cough and sob by 2 and then leaving out the rest? Please Would like to know |
| Re: A Python Program To Check The Risk Of Corona Virus. by LoveElfrida(m): 5:17pm On Mar 14, 2020 |
Dthinkerman:Hi, the IDE(with inbuilt editor) is Dcoder. Its available on Playstore.
|
| Re: A Python Program To Check The Risk Of Corona Virus. by pixey(m): 7:31am On Mar 15, 2020 |
devkolya:OOP is very cool but he followed the rules of readability except adding comments .Simple is better than complex, complex is better than complicated. ![]() |
| Re: A Python Program To Check The Risk Of Corona Virus. by swoopiness(m): 9:58am On Mar 20, 2020 |
pixey:Dirty python user , i see you lol |
| Re: A Python Program To Check The Risk Of Corona Virus. by IceColdVeins(m): 10:15am On Mar 20, 2020 |
Too cumbersome, honestly Kubernetes: |
Help With This Python Program • How Block Chain Can Solve The Problem Of Corona Virus • Help! How To Make Your Java Or Python Program Become A Real Android App? • 2 • 3 • 4
Thread closed. • How To Run C# Codes Without Having To Install Visual Studio • The Only Thing I Know About Programming Is Its Spelling, How Do I Start?


