Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import sys
- DISCLAIMER = '''
- CAUTION: THIS IS NOT A PROFESSIONAL ASSESSMENT. DO NOT SEEK MEDICATION WITHOUT
- FIRST RECEIVING A PROFESSIONAL MEDICAL ASSESSMENT. THESE QUESTIONS AND
- RESULTS HAVE BEEN GATHERED FROM THE INTERNET.
- '''
- def show_options():
- options = [
- 'Not at all',
- 'Just a little',
- 'Somewhat',
- 'Moderately',
- 'Quite a lot',
- 'Very much',
- ]
- print
- print 'Your options are:'
- for i, option in enumerate(options):
- print '\t%d. '%(i + 1) + option
- print 'Type \'quit\' without quotes to quit early.'
- print 'Type \'help\' to see this help again.'
- def process(score):
- if score < 9*3: return 'No depression likely'
- if score < 9*4: return 'Possibly Mildly Depressed'
- if score < 9*5: return 'Borderline Depression'
- if score < 9*6: return 'Mild-Moderate Depression'
- if score < 9*7: return 'Moderate-Severe Depression'
- else: return 'Severely Depressed'
- def main():
- questions = [
- 'I do things slowly.',
- 'My future seems hopeless.',
- 'It is hard for me to concentrate on reading.',
- 'The pleasure and joy has gone out of my life.',
- 'I have difficulty making decisions.',
- 'I have lost interest in aspects of my life that used to be important to me.',
- 'I feel sad, blue, and unhappy.',
- 'I am agitated and keep moving around.',
- 'I feel fatigued.',
- 'It takes great effort for me to do simple things.',
- 'I feel that I am a guilty person who deserves to be punished.',
- 'I feel like a failure.',
- 'I feel lifeless more dead than alive.',
- 'I\'m getting too much, too little or not enough restful sleep.',
- 'I spend time thinking about HOW I might kill myself.',
- 'I feel trapped or caught.',
- 'I feel depressed even when good things happen to me.',
- 'Without trying to diet, I have lost or gained weight.',
- ]
- print 'Are you depressed? Take this quick quiz to find out!'
- print 'You will be given 18 statements, and must rate how well each statement'
- print 'describes yourself on a scale from 1 to 6.'
- print
- print 'Start on the path of self discovery!'
- show_options()
- score = 0
- for i, question in enumerate(questions):
- print
- while True:
- prompt = '%d) '%(i + 1) + question + ' : '
- response = raw_input(prompt)
- if len(response) == 1 and 48 < ord(response) < 54:
- score += int(response)
- break
- elif response == 'help':
- show_options()
- elif response == 'quit':
- print 'bye bye'
- sys.exit(0)
- else:
- print 'Did not understand your response!'
- print 'Please try again. Type \'help\' for more info.'
- print
- print 'Your Score: %d' % score
- print 'Score Meaning: ' + process(score)
- print DISCLAIMER
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement