Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from time import sleep
- # user's abilities
- abilities_5_10 = []
- abilities_11_13 = []
- abilities_14_17 = []
- # user's goals
- goals_5_10 = []
- goals_11_13 = []
- goals_14_17 = []
- # user's fears
- fears_5_10 = []
- fears_11_13 = []
- fears_14_17 = []
- def full_check_list():
- """User's every list"""
- # prints user's inputted abilities
- print("Your abilities between the ages of 5-10 are,", abilities_5_10)
- print("Your abilities between the ages of 11-13 are,", abilities_11_13)
- print("Your abilities between the ages of 14-17 are,", abilities_14_17)
- print("\n")
- # prints user's inputted goals
- print("Your goals between the ages of 5-10 are,", goals_5_10)
- print("Your goals between the ages of 11-13 are,", goals_11_13)
- print("Your goals between the ages of 14-17 are,", goals_14_17)
- print("\n")
- # prints user's inputted fears
- print("Your fears between the ages of 5-10 are,", fears_5_10)
- print("Your fears between the ages of 11-13 are,", fears_11_13)
- print("Your fears between the ages of 14-17 are,", fears_14_17)
- print("\n")
- def user_back_continue():
- """Asks the user to go back or to check other lists"""
- while True:
- user_back = input("-> [1] Go back? // [2] Check other lists: ")
- if user_back == "1":
- print("\x1b[2J")
- user_start()
- break
- elif user_back == "2":
- print("\x1b[2J")
- check_lists()
- break
- else:
- print("Invalid response, try again.\n")
- continue
- def check_lists():
- """Used to check the lists"""
- print("\x1b[2J")
- check_list = input("""
- _____________________________________________
- |____\033[4mWhat list would you like to check?\033[0m______|
- |[1] Ability 5-10 y/o | [7] Fears 5-10 y/o |
- |[2] Ability 11-13 y/o | [8] Fears 11-13 y/o |
- |[3] Ability 14-17 y/o | [9] Fears 14-17 y/o |
- |[4] Goal 5-10 y/o | [10] CHECK ALL |
- |[5] Goal 11-13 y/o | |
- |[6] Goal 14-17 y/o | |
- [============================================]
- Only enter the number: """)
- if check_list == "1":
- print("\nYour abilities between the ages of 5-10 are,", abilities_5_10)
- user_back_continue()
- elif check_list == "2":
- print("\nYour abilities between the ages of 11-13 are,", abilities_11_13)
- user_back_continue()
- elif check_list == "3":
- print("\nYour abilities between the ages of 14-17 are,", abilities_14_17)
- user_back_continue()
- elif check_list == "4":
- print("\nYour goals between the ages of 5-10 are,", goals_5_10)
- user_back_continue()
- elif check_list == "5":
- print("\nYour goals between the ages of 11-13 are,", goals_11_13)
- user_back_continue()
- elif check_list == "6":
- print("\nYour goals between the ages of 14-17 are,", goals_14_17)
- user_back_continue()
- elif check_list == "7":
- print("\nYour fears between the ages of 5-10 are,", fears_5_10)
- user_back_continue()
- elif check_list == "8":
- print("\nYour fears between the ages of 11-13 are,", fears_11_13)
- user_back_continue()
- elif check_list == "9":
- print("\nYour fears between the ages of 14-17 are,", fears_14_17)
- user_back_continue()
- elif check_list == "10":
- print("\n")
- full_check_list()
- user_back_continue()
- else:
- check_lists()
- def continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17):
- """asks the user if they want to continue modifying the list"""
- while True:
- print("\x1b[2J")
- print(f" Current Category: {current_category}")
- print(f" Updated list: {choose_list}")
- user_return_continue = input("-> Do you want to continue modifying this list? (Y/N): ")
- if user_return_continue.lower() == "y":
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- elif user_return_continue == "n":
- return_message = " Now returning you....."
- for char in return_message:
- sleep(0.1)
- sys.stdout.write(char)
- user_start()
- break
- else:
- invalid_resp = " Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- def universal_add(choose_list):
- modify_add = input("-> Enter one value to be added: ")
- choose_list.append(modify_add)
- successful_add = f" '{modify_add}' was succesfully added! "
- for char in successful_add:
- sleep(0.1)
- sys.stdout.write(char)
- def universal_insert(choose_list):
- modify_insert = input("-> Enter one value to be inserted: ")
- while True:
- try:
- print("\n\033[1;3mNote: When indexing a value from a list, 0 is the starting point!\033[0m")
- choose_position = int(input(f"-> Where would you like to insert '{modify_insert}'?: "))
- choose_list.insert(choose_position, modify_insert)
- successful_add = f" '{modify_insert}' was succesfully inserted! "
- for char in successful_add:
- sleep(0.1)
- sys.stdout.write(char)
- break
- except:
- invalid_index = " Invalid index, try again. \n\n"
- for char in invalid_index:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- def universal_remove(choose_list, current_category):
- while True:
- try:
- modify_remove = input("-> Enter the value from the list you want to remove: ")
- successful_remove = f" '{choose_list[modify_remove]}' was succesfully removed! "
- for char in successful_remove:
- sleep(0.1)
- sys.stdout.write(char)
- choose_list.remove(modify_remove)
- break
- except:
- invalid_index = " Invalid index, try again. \n\n"
- for char in invalid_index:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- def universal_pop(choose_list, current_category, category_5_10, category_11_13, category_14_17):
- current_category = current_category
- while True:
- try:
- print("\n\033[1;3mNote: When popping a value from a list, 0 is the starting point!\033[0m")
- print("\033[1;3m Stuck? Enter '911' to return!\033[0m")
- modify_pop = int(input("-> What index would you like to pop?: "))
- if modify_pop == 911:
- return_message = " Now returning you... "
- for char in return_message:
- sleep(0.1)
- sys.stdout.write(char)
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- else:
- successful_pop = f" '{choose_list[modify_pop]}' was succesfully popped! "
- for char in successful_pop:
- sleep(0.1)
- sys.stdout.write(char)
- choose_list.pop(modify_pop)
- break
- except:
- invalid_index = " Invalid index, try again. \n\n"
- for char in invalid_index:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- def universal_clear(current_category, choose_list, category_5_10, category_11_13, category_14_17):
- while True:
- print(f" Current Category: {current_category}")
- print(f" Updated list: {choose_list}")
- modify_clear = input("-> Warning: This is going to clear this list. Continue? (Y/N): ")
- if modify_clear == "y":
- choose_list.clear()
- successful_clear = " The list was succesfully cleared! "
- for char in successful_clear:
- sleep(0.1)
- sys.stdout.write(char)
- break
- elif modify_clear == "n":
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- def universal_extend(category_5_10, category_11_13, category_14_17):
- list_category = []
- list_category.extend(category_5_10)
- list_category.extend(category_11_13)
- list_category.extend(category_14_17)
- print(f"All abilities combined in all ages ==> {list_category}")
- input("Click enter if you are done")
- def universal_return():
- user_start()
- def modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17):
- while True:
- print("\x1b[2J")
- modify_category = input(f"""
- ---> {current_category} <---
- ===============================================================================
- || [1]: Add item | -> adds a new item at the end of the list ||
- || [2]: Insert item | -> inserts an item at any position on the list ||
- || [3]: Remove item | -> removes an item by entering the value to be removed ||
- || [4]: Pop item | -> removes an item using indexing (e.g: [1]) ||
- || [5]: Clear list | -> clears the entire list ||
- || [6]: Extend | -> joins every value of your abilities together ||
- || [7]: Return | -> returns you from the start ||
- ===============================================================================
- Updated list: {choose_list}
- -> Only enter the choices available: """)
- # add item
- if modify_category == "1":
- universal_add(choose_list)
- continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- # insert item
- elif modify_category == "2":
- universal_insert(choose_list)
- continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- # remove item
- elif modify_category == "3":
- universal_remove(choose_list, current_category)
- continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- # pop item
- elif modify_category == "4":
- universal_pop(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- # clear list
- elif modify_category == "5":
- universal_clear(current_category, choose_list, category_5_10, category_11_13, category_14_17)
- continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- # extend
- elif modify_category == "6":
- universal_extend(category_5_10, category_11_13, category_14_17)
- continue_modify(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- # return
- elif modify_category == "7":
- universal_return()
- break
- else:
- invalid_resp = " Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- def user_start():
- """Starting Questions"""
- print("\x1b[2J")
- print("Guide Question: What are your ??? between the ages of ???\n")
- while True:
- print("What are your ??? (Abilities [A], Goals [G], Fears [F])")
- print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
- user_choose_mind = input("-> Only enter the choices available: ")
- if user_choose_mind.lower() == "a":
- while True:
- print("\x1b[2J")
- print("Guide Question: What are your abilities between the ages of ???\n")
- print("\nYour abilities between the ages ??? (5-10 [A], 11-13 [B], 14-17 [C])")
- print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
- category_5_10 = abilities_5_10
- category_11_13 = abilities_11_13
- category_14_17 = abilities_14_17
- choose_age_a = input("-> Only enter the choices available: ")
- if choose_age_a.lower() == "a":
- print("\x1b[2J")
- choose_list = abilities_5_10
- current_category = "Your abilities between the ages 5-10 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_a.lower() == "b":
- print("\x1b[2J")
- choose_list = abilities_11_13
- current_category = "Your abilities between the ages 11-13 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_a.lower() == "c":
- print("\x1b[2J")
- choose_list = abilities_14_17
- current_category = "Your abilities between the ages 14-17 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_a.lower() == "check":
- check_lists()
- break
- else:
- invalid_resp = "Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- break
- elif user_choose_mind.lower() == "g":
- while True:
- print("\x1b[2J")
- print("Guide Question: What are your goals between the ages of ???\n")
- print("\nYour goals between the ages ??? (5-10 [A], 11-13 [B], 14-17 [C])")
- print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
- category_5_10 = goals_5_10
- category_11_13 = goals_11_13
- category_14_17 = goals_14_17
- choose_age_g = input("-> Only enter the choices available: ")
- if choose_age_g.lower() == "a":
- print("\x1b[2J")
- choose_list = goals_5_10
- current_category = "Your goals between the ages 5-10 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_g.lower() == "b":
- print("\x1b[2J")
- choose_list = goals_11_13
- current_category = "Your goals between the ages 11-13 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_g.lower() == "c":
- print("\x1b[2J")
- choose_list = goals_14_17
- current_category = "Your goals between the ages 14-17 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_g.lower() == "check":
- check_lists()
- break
- else:
- invalid_resp = "Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- break
- elif user_choose_mind.lower() == "f":
- while True:
- print("\x1b[2J")
- print("Guide Question: What are your fears between the ages of ???\n")
- print("\nYour fears between the ages ??? (5-10 [A], 11-13 [B], 14-17 [C])")
- print("\033[1;3mNote: You can check your updated lists by typing 'Check'.\033[0m\n")
- category_5_10 = fears_5_10
- category_11_13 = fears_11_13
- category_14_17 = fears_14_17
- choose_age_f = input("-> Only enter the choices available: ")
- if choose_age_f.lower() == "a":
- print("\x1b[2J")
- choose_list = fears_5_10
- current_category = "Your fears between the ages 5-10 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_f.lower() == "b":
- print("\x1b[2J")
- choose_list = fears_11_13
- current_category = "Your fears between the ages 11-13 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_f.lower() == "c":
- print("\x1b[2J")
- choose_list = fears_14_17
- current_category = "Your fears between the ages 14-17 y/o"
- modify_category(choose_list, current_category, category_5_10, category_11_13, category_14_17)
- break
- elif choose_age_f.lower() == "check":
- check_lists()
- break
- else:
- invalid_resp = "Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- continue
- break
- elif user_choose_mind.lower() == "check":
- check_lists()
- break
- else:
- invalid_resp = " Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- print("\x1b[2J")
- continue
- def ask_user_continue():
- """Asking the user if he/she wants to continue"""
- while True:
- print("Welcome! I am a program that will ask some questions about your abilities, "
- "goals, and fears during the ages of 5–10, 11–13, and 14–17.")
- ask_continue = input("-> Do you want to accept and continue? (Y/N): ")
- if ask_continue.lower() == "y":
- print("\x1b[2J")
- user_start()
- break
- elif ask_continue.lower() == "n":
- print("Ok thank you for your time!")
- break
- else:
- invalid_resp = " Invalid response, try again. "
- for char in invalid_resp:
- sleep(0.1)
- sys.stdout.write(char)
- print("\x1b[2J")
- continue
- ask_user_continue()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement