Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. def get_input():
  2. choice = -1
  3. while choice < 1 & choice > 4:
  4. choice = float(input("Your answer: "))
  5. return choice - 1
  6.  
  7. print("This is the Beck Depression Inventory.")
  8. print("The results of this test are inconclusive,")
  9. print("but they can be used to assess the need for a diagnosis.")
  10. print("-----------------------------------------------------------")
  11. print("Choose the statement that best describes your feelings")
  12. print("during the last two weeks, including today.")
  13. print("Choose only one alternative. If several options seem")
  14. print("to fit equally well, choose the highest number.")
  15. print("After choosing a number, press 'enter' ")
  16. print(" ")
  17. name = input("To start, enter your name: ")
  18.  
  19. questions : [
  20. ## first set
  21. ("Sadness:", "1. I do not feel sad.", "2. I feel sad much of the time.", "3. I am sad all the time.","4. I am so sad or unhappy that I can't stand it."),
  22. ## second set
  23. ("Pessimism:", "1. I am not discouraged about my future.", "2. I feel more discouraged about my future than I used to be.", "3. I do not expect things to work out for me.", "4. I feel my future is hopeless and will only get worse.")
  24. ]
  25.  
  26. count = 0
  27. for question in questions:
  28. for option in question:
  29. print(option)
  30. print('')
  31. count = count + get_input()
  32.  
  33. print(" ")
  34. print(" ")
  35. print("Past failure:")
  36. print("1. I do not feel like a failure.")
  37. print("2. I have failed more than I should have.")
  38. print("3. As I look back, I see a lot of failures.")
  39. print("4. I feel I am a total failure as a person.")
  40.  
  41. choice1 = float(input("Your answer: "))
  42. if choice1 == 1:
  43. count = count
  44. elif choice1 == 2:
  45. count = count + 1
  46. elif choice1 == 3:
  47. count = count + 2
  48. elif choice1 == 4:
  49. count = count + 3
  50. else:
  51. choice1 = float(input("Your answer: "))
  52.  
  53. print(" ")
  54. print(" ")
  55. print("Loss of pleasure:")
  56. print("1. I get as much pleasure as I ever did from the things I enjoy.")
  57. print("2. I don't enjoy things as much as I used to.")
  58. print("3. I get very little pleasure from the things I used to enjoy.")
  59. print("4. I can't get any pleasure from the things I used to enjoy.")
  60.  
  61. choice1 = float(input("Your answer: "))
  62. if choice1 == 1:
  63. count = count
  64. elif choice1 == 2:
  65. count = count + 1
  66. elif choice1 == 3:
  67. count = count + 2
  68. elif choice1 == 4:
  69. count = count + 3
  70. else:
  71. choice1 = float(input("Your answer: "))
  72.  
  73. print(" ")
  74. print(" ")
  75. print("Guilty feelings:")
  76. print("1. I don't feel particularly guilty.")
  77. print("2. I feel guilty over many things I have done or should have done.")
  78. print("3. I feel quite guilty most of the time.")
  79. print("4. I feel guilty all of the time.")
  80.  
  81. choice1 = float(input("Your answer: "))
  82. if choice1 == 1:
  83. count = count
  84. elif choice1 == 2:
  85. count = count + 1
  86. elif choice1 == 3:
  87. count = count + 2
  88. elif choice1 == 4:
  89. count = count + 3
  90. else:
  91. choice1 = float(input("Your answer: "))
  92.  
  93.  
  94. print(" ")
  95. print(" ")
  96. print("Punishment feelings:")
  97. print("1. I don't feel I am being punished.")
  98. print("2. I feel I may be punished.")
  99. print("3. I expect to be punished.")
  100. print("4. I feel I am being punished.")
  101.  
  102. choice1 = float(input("Your answer: "))
  103. if choice1 == 1:
  104. count = count
  105. elif choice1 == 2:
  106. count = count + 1
  107. elif choice1 == 3:
  108. count = count + 2
  109. elif choice1 == 4:
  110. count = count + 3
  111. else:
  112. choice1 = float(input("Your answer: "))
  113.  
  114.  
  115. print(" ")
  116. print(" ")
  117. print("Self-dislike:")
  118. print("1. I feel the same about myself as ever.")
  119. print("2. I have lost confidence in myself.")
  120. print("3. I am disappointed in myself.")
  121. print("4. I dislike myself.")
  122.  
  123. choice1 = float(input("Your answer: "))
  124. if choice1 == 1:
  125. count = count
  126. elif choice1 == 2:
  127. count = count + 1
  128. elif choice1 == 3:
  129. count = count + 2
  130. elif choice1 == 4:
  131. count = count + 3
  132. else:
  133. choice1 = float(input("Your answer: "))
  134.  
  135.  
  136. print(" ")
  137. print(" ")
  138. print("Self-criticalness:")
  139. print("1. I don't criticize or blame myself more than usual.")
  140. print("2. I am more critical of myself than I used to be.")
  141. print("3. I criticize myself for all of my faults.")
  142. print("4. I blame myself for everything bad that happens.")
  143.  
  144. choice1 = float(input("Your answer: "))
  145. if choice1 == 1:
  146. count = count
  147. elif choice1 == 2:
  148. count = count + 1
  149. elif choice1 == 3:
  150. count = count + 2
  151. elif choice1 == 4:
  152. count = count + 3
  153. else:
  154. choice1 = float(input("Your answer: "))
  155.  
  156.  
  157. print(" ")
  158. print(" ")
  159. print("Suicidal thoughts or wishes:")
  160. print("1. I don't have any thoughts of killing myself.")
  161. print("2. I have thoughts of killing myself, but I would not carry them out.")
  162. print("3. I would like to kill myself.")
  163. print("4. I would kill myself if I had the chance.")
  164.  
  165. choice1 = float(input("Your answer: "))
  166. if choice1 == 1:
  167. count = count
  168. elif choice1 == 2:
  169. count = count + 1
  170. elif choice1 == 3:
  171. count = count + 2
  172. elif choice1 == 4:
  173. count = count + 3
  174. else:
  175. choice1 = float(input("Your answer: "))
  176.  
  177.  
  178. print(" ")
  179. print(" ")
  180. print("Crying:")
  181. print("1. I don't cry any more than I used to.")
  182. print("2. I cry more than I used to.")
  183. print("3. I cry over every little thing.")
  184. print("4. I feel like crying, but can't.")
  185.  
  186. choice1 = float(input("Your answer: "))
  187. if choice1 == 1:
  188. count = count
  189. elif choice1 == 2:
  190. count = count + 1
  191. elif choice1 == 3:
  192. count = count + 2
  193. elif choice1 == 4:
  194. count = count + 3
  195. else:
  196. choice1 = float(input("Your answer: "))
  197.  
  198.  
  199. print(" ")
  200. print(" ")
  201. print("Agitation:")
  202. print("1. I am no more restless or wound up than usual.")
  203. print("2. I feel more restless or wound up than usual.")
  204. print("3. I am so restless or agitated that it's hard to stay still.")
  205. print("4. I am so restless or agitated that I have to keep moving")
  206. print("or doing something.")
  207.  
  208. choice1 = float(input("Your answer: "))
  209. if choice1 == 1:
  210. count = count
  211. elif choice1 == 2:
  212. count = count + 1
  213. elif choice1 == 3:
  214. count = count + 2
  215. elif choice1 == 4:
  216. count = count + 3
  217. else:
  218. choice1 = float(input("Your answer: "))
  219.  
  220.  
  221. print(" ")
  222. print(" ")
  223. print("Loss of interest:")
  224. print("1. I have not lost interest in other people or activities.")
  225. print("2. I am less interested in other people or things than before.")
  226. print("3. I have lost most of my interest in other people or things.")
  227. print("4. It's hard to get interested in anything.")
  228.  
  229.  
  230. choice1 = float(input("Your answer: "))
  231. if choice1 == 1:
  232. count = count
  233. elif choice1 == 2:
  234. count = count + 1
  235. elif choice1 == 3:
  236. count = count + 2
  237. elif choice1 == 4:
  238. count = count + 3
  239. else:
  240. choice1 = float(input("Your answer: "))
  241.  
  242.  
  243. print(" ")
  244. print(" ")
  245. print("Indecisiveness:")
  246. print("1. I make decisions about as well as ever.")
  247. print("2. I find it more difficult to make decisions than usual.")
  248. print("3. I have much greater difficulty in making decisions than I used to.")
  249. print("4. I have trouble making any decision.")
  250.  
  251. choice1 = float(input("Your answer: "))
  252. if choice1 == 1:
  253. count = count
  254. elif choice1 == 2:
  255. count = count + 1
  256. elif choice1 == 3:
  257. count = count + 2
  258. elif choice1 == 4:
  259. count = count + 3
  260. else:
  261. choice1 = float(input("Your answer: "))
  262.  
  263.  
  264. print(" ")
  265. print(" ")
  266. print("Worhtlessness:")
  267. print("1. I do not feel I am worthless.")
  268. print("2. I don't consider myself as worthwhile and useful as I used to.")
  269. print("3. I feel more worthless compared to other people.")
  270. print("4. I feel utterly worthless.")
  271.  
  272. choice1 = float(input("Your answer: "))
  273. if choice1 == 1:
  274. count = count
  275. elif choice1 == 2:
  276. count = count + 1
  277. elif choice1 == 3:
  278. count = count + 2
  279. elif choice1 == 4:
  280. count = count + 3
  281. else:
  282. choice1 = float(input("Your answer: "))
  283.  
  284.  
  285. print(" ")
  286. print(" ")
  287. print("Loss of energy:")
  288. print("1. I have as much energy as ever.")
  289. print("2. I have less energy than I used to have.")
  290. print("3. I don't have energy to do very much.")
  291. print("4. I don't have enough energy to do anything.")
  292.  
  293. choice1 = float(input("Your answer: "))
  294. if choice1 == 1:
  295. count = count
  296. elif choice1 == 2:
  297. count = count + 1
  298. elif choice1 == 3:
  299. count = count + 2
  300. elif choice1 == 4:
  301. count = count + 3
  302. else:
  303. choice1 = float(input("Your answer: "))
  304.  
  305.  
  306. print(" ")
  307. print(" ")
  308. print("Changes in sleeping pattern:")
  309. print("1. I have not experienced any change in my sleeping pattern.")
  310. print("2. I sleep somewhat more/less than usual.")
  311. print("3. I sleep a lot more/less than usual.")
  312. print("4. I sleep most of the day / I wake up 1-2 hours early and")
  313. print("can't get back to sleep.")
  314.  
  315. choice1 = float(input("Your answer: "))
  316. if choice1 == 1:
  317. count = count
  318. elif choice1 == 2:
  319. count = count + 1
  320. elif choice1 == 3:
  321. count = count + 2
  322. elif choice1 == 4:
  323. count = count + 3
  324. else:
  325. choice1 = float(input("Your answer: "))
  326.  
  327.  
  328. print(" ")
  329. print(" ")
  330. print("Irritability:")
  331. print("1. I am no more irritable than usual.")
  332. print("2. I am more irritable than usual.")
  333. print("3. I am much more irritable than usual.")
  334. print("4. I am irritable all the time.")
  335.  
  336. choice1 = float(input("Your answer: "))
  337. if choice1 == 1:
  338. count = count
  339. elif choice1 == 2:
  340. count = count + 1
  341. elif choice1 == 3:
  342. count = count + 2
  343. elif choice1 == 4:
  344. count = count + 3
  345. else:
  346. choice1 = float(input("Your answer: "))
  347.  
  348.  
  349. print(" ")
  350. print(" ")
  351. print("Changes in appetite:")
  352. print("1. I have not experienced any changes in my appetite.")
  353. print("2. My appetite is somewhat greater/less than usual.")
  354. print("3. My appetite is much greater/less than usual.")
  355. print("4. I have no appetite at all / I crave food all the time.")
  356.  
  357. choice1 = float(input("Your answer: "))
  358. if choice1 == 1:
  359. count = count
  360. elif choice1 == 2:
  361. count = count + 1
  362. elif choice1 == 3:
  363. count = count + 2
  364. elif choice1 == 4:
  365. count = count + 3
  366. else:
  367. choice1 = float(input("Your answer: "))
  368.  
  369.  
  370. print(" ")
  371. print(" ")
  372. print("Concentration difficulty:")
  373. print("1. I can concentrate as well as ever.")
  374. print("2. I can't concentrate as well as usual.")
  375. print("3. It's hard to keep my mind on anything for very long.")
  376. print("4. I find I can't concentrate on anything.")
  377.  
  378. choice1 = float(input("Your answer: "))
  379. if choice1 == 1:
  380. count = count
  381. elif choice1 == 2:
  382. count = count + 1
  383. elif choice1 == 3:
  384. count = count + 2
  385. elif choice1 == 4:
  386. count = count + 3
  387. else:
  388. choice1 = float(input("Your answer: "))
  389.  
  390.  
  391. print(" ")
  392. print(" ")
  393. print("Tiredness or fatigue:")
  394. print("1. I am no more tired or fatigued than usual.")
  395. print("2. I get more tired or fatigued more easily than usual.")
  396. print("3. I am too tired or fatigued to do a lot of the things I used to do.")
  397. print("4. I am too tired or fatigued to do most of the things I used to do.")
  398.  
  399. choice1 = float(input("Your answer: "))
  400. if choice1 == 1:
  401. count = count
  402. elif choice1 == 2:
  403. count = count + 1
  404. elif choice1 == 3:
  405. count = count + 2
  406. elif choice1 == 4:
  407. count = count + 3
  408. else:
  409. choice1 = float(input("Your answer: "))
  410.  
  411.  
  412. print(" ")
  413. print(" ")
  414. print("Loss of interest in sex:")
  415. print("1. I have not noticed any recent change in my interest in sex.")
  416. print("2. I am less interested in sex than I used to be.")
  417. print("3. I am much less interested in sex now.")
  418. print("4. I have lost interest in sex completely.")
  419.  
  420. choice1 = float(input("Your answer: "))
  421. if choice1 == 1:
  422. count = count
  423. elif choice1 == 2:
  424. count = count + 1
  425. elif choice1 == 3:
  426. count = count + 2
  427. elif choice1 == 4:
  428. count = count + 3
  429. else:
  430. choice1 = float(input("Your answer: "))
  431.  
  432.  
  433.  
  434. print(" ")
  435. print("--------------")
  436. print(" ")
  437. print("Your score:", count)
  438. if count <= 13:
  439. print("The results indicate no depression or minimal depression.")
  440. elif count <= 19:
  441. print("The results indicate mild depression.")
  442. elif count <= 28:
  443. print("The results indicate moderate depression.")
  444. elif count > 28:
  445. print("The results indicate severe depression.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement