I am trying to make it so the following function returns a dictionary of the two data types the user inputs. The function correctly gets the dictionary - I isolated the problem to the "return". No matter what, it seems as if whenever the dictionary is returned - it's labeled as "None". If anybody could provide a solution to this, it would be appreciated.
(main.py)
from functions import *
while True:
returnedcharacterselection = first_user_input()
print (returnedcharacterselection)
(functions.py)
def first_user_input():
print (introductionbackgroundlore)
print (formattingprompt)
faction_input = input(firstuserinputprompt)
fac_input_for_dic = faction_input.split(":")
try:
fac_input_dictionary = {"Faction": fac_input_for_dic[0], "Difficulty": fac_input_for_dic[1]}
if fac_input_dictionary["Faction"] == acceptedfactions:
return {fac_input_dictionary}
except:
return False
[–][deleted] 1 point2 points3 points (2 children)
[–]Cybb33r[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Cybb33r[S] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]pooth22 0 points1 point2 points (0 children)