Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,208,589 members, 8,003,051 topics. Date: Friday, 15 November 2024 at 05:49 AM

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. (2093 Views)

Help With This Python Program / Help! How To Make Your Java Or Python Program Become A Real Android App? / How To Run Python Program On Android (2) (3) (4)

(1) (Reply) (Go Down)

A Python Program To Check The Risk Of Corona Virus. by Kubernetes: 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,"wink
else: print("you have how risk of COVID 19 infection,"wink
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, "wink

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)

3 Likes 1 Share

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:
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,"wink
else: print("you have how risk of COVID 19 infection,"wink
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, "wink

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)


Original tramadol extra na watin dey high you
Re: A Python Program To Check The Risk Of Corona Virus. by Kubernetes: 9:17pm On Mar 10, 2020
Venzee:



Original tramadol extra na watin dey high you

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
Kubernetes:
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,"wink
else: print("you have how risk of COVID 19 infection,"wink
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, "wink

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)

Great job, more grease to your elbow. Although correct the bolded to low

1 Like

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 smiley
Re: A Python Program To Check The Risk Of Corona Virus. by Dthinkerman: 7:29pm On Mar 12, 2020
LoveElfrida:
Nice share, next time reference the original author.

Good to know that you code on a mobile too.

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:


Could you kindly let us know the mobile editor?

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:
Good but eeerm... would love to see a clean code probably in classes smiley
OOP is very cool but he followed the rules of readability except
adding comments .Simple is better than complex, complex is better than complicated. grin

1 Like

Re: A Python Program To Check The Risk Of Corona Virus. by swoopiness(m): 9:58am On Mar 20, 2020
pixey:
OOP is very cool but he followed the rules of readability except
adding comments .Simple is better than complex, complex is better than complicated. grin
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:
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,"wink
else: print("you have how risk of COVID 19 infection,"wink
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, "wink

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)

(1) (Reply)

Building My First Ios App. I Will Upload Videos Of My Progress Daily / Simple Algorithm Challenge / Caeser Cipher

Viewing this topic: 1 guest(s)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 31
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.