Advertisement
xi_arma

Untitled

Nov 21st, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.70 KB | None | 0 0
  1. import sys
  2. from time import sleep
  3.  
  4. # user's abilities
  5. abilities_5_10 = []
  6. abilities_11_13 = []
  7. abilities_14_17 = []
  8.  
  9. # user's goals
  10. goals_5_10 = []
  11. goals_11_13 = []
  12. goals_14_17 = []
  13.  
  14. # user's fears
  15. fears_5_10 = []
  16. fears_11_13 = []
  17. fears_14_17 = []
  18.  
  19.  
  20. def full_check_list():
  21. """User's every list"""
  22. # prints user's inputted abilities
  23. print("Your abilities between the ages of 5-10 are,", abilities_5_10)
  24. print("Your abilities between the ages of 11-13 are,", abilities_11_13)
  25. print("Your abilities between the ages of 14-17 are,", abilities_14_17)
  26. print("\n")
  27.  
  28. # prints user's inputted goals
  29. print("Your goals between the ages of 5-10 are,", goals_5_10)
  30. print("Your goals between the ages of 11-13 are,", goals_11_13)
  31. print("Your goals between the ages of 14-17 are,", goals_14_17)
  32. print("\n")
  33.  
  34. # prints user's inputted fears
  35. print("Your fears between the ages of 5-10 are,", fears_5_10)
  36. print("Your fears between the ages of 11-13 are,", fears_11_13)
  37. print("Your fears between the ages of 14-17 are,", fears_14_17)
  38. print("\n")
  39.  
  40. def user_back_continue():
  41. """Asks the user to go back or to check other lists"""
  42. while True:
  43. user_back = input("-> [1] Go back? // [2] Check other lists: ")
  44. if user_back == "1":
  45. print("\x1b[2J")
  46. user_start()
  47. break
  48. elif user_back == "2":
  49. print("\x1b[2J")
  50. check_lists()
  51. break
  52. else:
  53. print("Invalid response, try again.\n")
  54. continue
  55.  
  56. def check_lists():
  57. """Used to check the lists"""
  58. print("\x1b[2J")
  59. check_list = input("""
  60. _____________________________________________
  61. |____\033[4mWhat list would you like to check?\033[0m______|
  62. |[1] Ability 5-10 y/o | [7] Fears 5-10 y/o |
  63. |[2] Ability 11-13 y/o | [8] Fears 11-13 y/o |
  64. |[3] Ability 14-17 y/o | [9] Fears 14-17 y/o |
  65. |[4] Goal 5-10 y/o | [10] CHECK ALL |
  66. |[5] Goal 11-13 y/o | |
  67. |[6] Goal 14-17 y/o | |
  68. [============================================]
  69. Only enter the number: """)
  70. if check_list == "1":
  71. print("\nYour abilities between the ages of 5-10 are,", abilities_5_10)
  72. user_back_continue()
  73.  
  74. elif check_list == "2":
  75. print("\nYour abilities between the ages of 11-13 are,", abilities_11_13)
  76. user_back_continue()
  77.  
  78. elif check_list == "3":
  79. print("\nYour abilities between the ages of 14-17 are,", abilities_14_17)
  80. user_back_continue()
  81.  
  82. elif check_list == "4":
  83. print("\nYour goals between the ages of 5-10 are,", goals_5_10)
  84. user_back_continue()
  85.  
  86. elif check_list == "5":
  87. print("\nYour goals between the ages of 11-13 are,", goals_11_13)
  88. user_back_continue()
  89.  
  90. elif check_list == "6":
  91. print("\nYour goals between the ages of 14-17 are,", goals_14_17)
  92. user_back_continue()
  93.  
  94. elif check_list == "7":
  95. print("\nYour fears between the ages of 5-10 are,", fears_5_10)
  96. user_back_continue()
  97.  
  98. elif check_list == "8":
  99. print("\nYour fears between the ages of 11-13 are,", fears_11_13)
  100. user_back_continue()
  101.  
  102. elif check_list == "9":
  103. print("\nYour fears between the ages of 14-17 are,", fears_14_17)
  104. user_back_continue()
  105.  
  106. elif check_list == "10":
  107. print("\n")
  108. full_check_list()
  109. user_back_continue()
  110. else:
  111. check_lists()
  112.  
  113. def continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17):
  114. """asks the user if they want to continue modifying the list"""
  115. while True:
  116. print("\x1b[2J")
  117. print(f" Current Category: {current_category}")
  118. print(f" Updated list: {choose_list}")
  119. user_return_continue = input("-> Do you want to continue modifying this list? (Y/N): ")
  120. if user_return_continue.lower() == "y":
  121. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  122. elif user_return_continue == "n":
  123. return_message = " Now returning you....."
  124. for char in return_message:
  125. sleep(0.1)
  126. sys.stdout.write(char)
  127. user_start()
  128. break
  129.  
  130. else:
  131. invalid_resp = " Invalid response, try again. "
  132. for char in invalid_resp:
  133. sleep(0.1)
  134. sys.stdout.write(char)
  135. continue
  136.  
  137. def universal_add(choose_list):
  138. modify_add = input("-> Enter one value to be added: ")
  139. choose_list.append(modify_add)
  140. successful_add = f" '{modify_add}' was succesfully added! "
  141. for char in successful_add:
  142. sleep(0.1)
  143. sys.stdout.write(char)
  144.  
  145. def universal_insert(choose_list):
  146. modify_insert = input("-> Enter one value to be inserted: ")
  147. while True:
  148. try:
  149. print("\n\033[1;3mNote: When indexing a value from a list, 0 is the starting point!\033[0m")
  150. choose_position = int(input(f"-> Where would you like to insert '{modify_insert}'?: "))
  151. choose_list.insert(choose_position, modify_insert)
  152. successful_add = f" '{modify_insert}' was succesfully inserted! "
  153. for char in successful_add:
  154. sleep(0.1)
  155. sys.stdout.write(char)
  156. break
  157. except:
  158. invalid_index = " Invalid index, try again. \n\n"
  159. for char in invalid_index:
  160. sleep(0.1)
  161. sys.stdout.write(char)
  162. continue
  163.  
  164. def universal_remove(choose_list, current_category):
  165. while True:
  166. try:
  167. modify_remove = input("-> Enter the value from the list you want to remove: ")
  168. successful_remove = f" '{choose_list[modify_remove]}' was succesfully removed! "
  169. for char in successful_remove:
  170. sleep(0.1)
  171. sys.stdout.write(char)
  172. choose_list.remove(modify_remove)
  173. break
  174. except:
  175. invalid_index = " Invalid index, try again. \n\n"
  176. for char in invalid_index:
  177. sleep(0.1)
  178. sys.stdout.write(char)
  179. continue
  180.  
  181. def universal_pop(choose_list, current_category, category_5_10, category_11_13, category_14_17):
  182. current_category = current_category
  183. while True:
  184. try:
  185. print("\n\033[1;3mNote: When popping a value from a list, 0 is the starting point!\033[0m")
  186. print("\033[1;3m Stuck? Enter '911' to return!\033[0m")
  187. modify_pop = int(input("-> What index would you like to pop?: "))
  188. if modify_pop == 911:
  189. return_message = " Now returning you... "
  190. for char in return_message:
  191. sleep(0.1)
  192. sys.stdout.write(char)
  193. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  194. break
  195. else:
  196. successful_pop = f" '{choose_list[modify_pop]}' was succesfully popped! "
  197. for char in successful_pop:
  198. sleep(0.1)
  199. sys.stdout.write(char)
  200. choose_list.pop(modify_pop)
  201. break
  202. except:
  203. invalid_index = " Invalid index, try again. \n\n"
  204. for char in invalid_index:
  205. sleep(0.1)
  206. sys.stdout.write(char)
  207. continue
  208.  
  209. def universal_clear(current_category, choose_list, category_5_10, category_11_13, category_14_17):
  210. while True:
  211. print(f" Current Category: {current_category}")
  212. print(f" Updated list: {choose_list}")
  213. modify_clear = input("-> Warning: This is going to clear this list. Continue? (Y/N): ")
  214. if modify_clear == "y":
  215. choose_list.clear()
  216. successful_clear = " The list was succesfully cleared! "
  217. for char in successful_clear:
  218. sleep(0.1)
  219. sys.stdout.write(char)
  220. break
  221. elif modify_clear == "n":
  222. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  223. break
  224.  
  225. def universal_extend(category_5_10, category_11_13, category_14_17):
  226. list_category = []
  227. list_category.extend(category_5_10)
  228. list_category.extend(category_11_13)
  229. list_category.extend(category_14_17)
  230. print(f"All abilities combined in all ages ==> {list_category}")
  231. input("Click enter if you are done")
  232.  
  233. def universal_return():
  234. user_start()
  235.  
  236. def modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17):
  237. while True:
  238. print("\x1b[2J")
  239. modify_category = input(f"""
  240. ---> {current_category} <---
  241. ===============================================================================
  242. || [1]: Add item | -> adds a new item at the end of the list ||
  243. || [2]: Insert item | -> inserts an item at any position on the list ||
  244. || [3]: Remove item | -> removes an item by entering the value to be removed ||
  245. || [4]: Pop item | -> removes an item using indexing (e.g: [1]) ||
  246. || [5]: Clear list | -> clears the entire list ||
  247. || [6]: Extend | -> joins every value of your abilities together ||
  248. || [7]: Return | -> returns you from the start ||
  249. ===============================================================================
  250. Updated list: {choose_list}
  251. -> Only enter the choices available: """)
  252. # add item
  253. if modify_category == "1":
  254. universal_add(choose_list)
  255. continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  256. break
  257.  
  258. # insert item
  259. elif modify_category == "2":
  260. universal_insert(choose_list)
  261. continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  262. break
  263.  
  264. # remove item
  265. elif modify_category == "3":
  266. universal_remove(choose_list, current_category)
  267. continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  268. break
  269.  
  270. # pop item
  271. elif modify_category == "4":
  272. universal_pop(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  273. continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  274. break
  275.  
  276. # clear list
  277. elif modify_category == "5":
  278. universal_clear(current_category, choose_list, category_5_10, category_11_13, category_14_17)
  279. continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  280. break
  281.  
  282. # extend
  283. elif modify_category == "6":
  284. universal_extend(category_5_10, category_11_13, category_14_17)
  285. continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  286. break
  287.  
  288. # return
  289. elif modify_category == "7":
  290. universal_return()
  291. break
  292.  
  293. else:
  294. invalid_resp = " Invalid response, try again. "
  295. for char in invalid_resp:
  296. sleep(0.1)
  297. sys.stdout.write(char)
  298. continue
  299.  
  300. def user_start():
  301. """Starting Questions"""
  302. print("\x1b[2J")
  303. print("Guide Question: What are your ??? between the ages of ???\n")
  304. while True:
  305. print("What are your ??? (Abilities [A], Goals [G], Fears [F])")
  306. print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
  307. user_choose_mind = input("-> Only enter the choices available: ")
  308. if user_choose_mind.lower() == "a":
  309. while True:
  310. print("\x1b[2J")
  311. print("Guide Question: What are your abilities between the ages of ???\n")
  312. print("\nYour abilities between the ages ??? (5-10 [A], 11-13 [B], 14-17 [C])")
  313. print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
  314. category_5_10 = abilities_5_10
  315. category_11_13 = abilities_11_13
  316. category_14_17 = abilities_14_17
  317. choose_age_a = input("-> Only enter the choices available: ")
  318.  
  319. if choose_age_a.lower() == "a":
  320. print("\x1b[2J")
  321. choose_list = abilities_5_10
  322. current_category = "Your abilities between the ages 5-10 y/o"
  323. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  324. break
  325.  
  326. elif choose_age_a.lower() == "b":
  327. print("\x1b[2J")
  328. choose_list = abilities_11_13
  329. current_category = "Your abilities between the ages 11-13 y/o"
  330. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  331. break
  332.  
  333. elif choose_age_a.lower() == "c":
  334. print("\x1b[2J")
  335. choose_list = abilities_14_17
  336. current_category = "Your abilities between the ages 14-17 y/o"
  337. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  338. break
  339.  
  340. elif choose_age_a.lower() == "check":
  341. check_lists()
  342. break
  343.  
  344. else:
  345. invalid_resp = "Invalid response, try again. "
  346. for char in invalid_resp:
  347. sleep(0.1)
  348. sys.stdout.write(char)
  349. continue
  350. break
  351.  
  352.  
  353. elif user_choose_mind.lower() == "g":
  354. while True:
  355. print("\x1b[2J")
  356. print("Guide Question: What are your goals between the ages of ???\n")
  357. print("\nYour goals between the ages ??? (5-10 [A], 11-13 [B], 14-17 [C])")
  358. print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
  359. category_5_10 = goals_5_10
  360. category_11_13 = goals_11_13
  361. category_14_17 = goals_14_17
  362. choose_age_g = input("-> Only enter the choices available: ")
  363.  
  364. if choose_age_g.lower() == "a":
  365. print("\x1b[2J")
  366. choose_list = goals_5_10
  367. current_category = "Your goals between the ages 5-10 y/o"
  368. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  369. break
  370.  
  371. elif choose_age_g.lower() == "b":
  372. print("\x1b[2J")
  373. choose_list = goals_11_13
  374. current_category = "Your goals between the ages 11-13 y/o"
  375. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  376. break
  377.  
  378. elif choose_age_g.lower() == "c":
  379. print("\x1b[2J")
  380. choose_list = goals_14_17
  381. current_category = "Your goals between the ages 14-17 y/o"
  382. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  383. break
  384.  
  385. elif choose_age_g.lower() == "check":
  386. check_lists()
  387. break
  388.  
  389. else:
  390. invalid_resp = "Invalid response, try again. "
  391. for char in invalid_resp:
  392. sleep(0.1)
  393. sys.stdout.write(char)
  394. continue
  395. break
  396.  
  397. elif user_choose_mind.lower() == "f":
  398. while True:
  399. print("\x1b[2J")
  400. print("Guide Question: What are your fears between the ages of ???\n")
  401. print("\nYour fears between the ages ??? (5-10 [A], 11-13 [B], 14-17 [C])")
  402. print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
  403. category_5_10 = fears_5_10
  404. category_11_13 = fears_11_13
  405. category_14_17 = fears_14_17
  406. choose_age_f = input("-> Only enter the choices available: ")
  407.  
  408. if choose_age_f.lower() == "a":
  409. print("\x1b[2J")
  410. choose_list = fears_5_10
  411. current_category = "Your fears between the ages 5-10 y/o"
  412. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  413. break
  414.  
  415. elif choose_age_f.lower() == "b":
  416. print("\x1b[2J")
  417. choose_list = fears_11_13
  418. current_category = "Your fears between the ages 11-13 y/o"
  419. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  420. break
  421.  
  422. elif choose_age_f.lower() == "c":
  423. print("\x1b[2J")
  424. choose_list = fears_14_17
  425. current_category = "Your fears between the ages 14-17 y/o"
  426. modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
  427. break
  428.  
  429. elif choose_age_f.lower() == "check":
  430. check_lists()
  431. break
  432.  
  433. else:
  434. invalid_resp = "Invalid response, try again. "
  435. for char in invalid_resp:
  436. sleep(0.1)
  437. sys.stdout.write(char)
  438. continue
  439. break
  440.  
  441. elif user_choose_mind.lower() == "check":
  442. check_lists()
  443. break
  444.  
  445. else:
  446. invalid_resp = " Invalid response, try again. "
  447. for char in invalid_resp:
  448. sleep(0.1)
  449. sys.stdout.write(char)
  450. print("\x1b[2J")
  451. continue
  452.  
  453. def ask_user_continue():
  454. """Asking the user if he/she wants to continue"""
  455. while True:
  456. print("Welcome! I am a program that will ask some questions about your abilities, "
  457. "goals, and fears during the ages of 5–10, 11–13, and 14–17.")
  458. ask_continue = input("-> Do you want to accept and continue? (Y/N): ")
  459. if ask_continue.lower() == "y":
  460. print("\x1b[2J")
  461. user_start()
  462. break
  463. elif ask_continue.lower() == "n":
  464. print("Ok thank you for your time!")
  465. break
  466. else:
  467. invalid_resp = " Invalid response, try again. "
  468. for char in invalid_resp:
  469. sleep(0.1)
  470. sys.stdout.write(char)
  471. print("\x1b[2J")
  472. continue
  473.  
  474. ask_user_continue()
  475.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement