Skip to content

Instantly share code, notes, and snippets.

@anishmashankar
Created April 1, 2015 05:26
Show Gist options
  • Save anishmashankar/efe874172ea0da7c1d14 to your computer and use it in GitHub Desktop.
Save anishmashankar/efe874172ea0da7c1d14 to your computer and use it in GitHub Desktop.
import sys
symptoms={
'tb' : ['cough', 'pain', 'weight loss', 'exhaustion', 'fever','night sweat','chills'],
'dengue': ['pain', 'swollen lympth node', 'fever', 'exhaustion'],
'h1n1' : ['cough', 'fever', 'sore throat', 'runny nose', 'pain', 'headache', 'chills', 'exhaustion']
}
print 'do you have fever?'
fever = input()
if fever==0:
sys.exit()
print 'are you experiencing pain? '
pain = input()
if pain:
print 'you might have tb, dengue or h1n1'
print 'do you have any kind of cough?'
cough = input()
if cough:
print 'you might have dengue or tb'
print 'please answer these questions now...'
print 'do you have a swollen lymth node?'
if input()==1:
print 'you have dengue'
else:
print 'you have tb or h1n1'
print 'now answer the following questions: '
print 'do you have a chills'
if input()==1:
print 'still not decided if tb or h1n1'
print 'do you have a running nose?'
if input()==1:
print 'you have tb'
sys.exit()
print 'are you experiencing sore throad?'
if input()==1:
print 'yyou have h1n1'
sys.exit()
else:
print 'you might only have a common fever'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment