I'm learning python, working with the sl4a to make a phone app. I'm having trouble with a dictionnary when passing it as a parameter. I've searched to see if someone had that problem already and found some alike questions but couldn't figure my mistake out.
Here's the the code (I removed all unrelevant parts):
def choiceForm(screenTitle, choices, posMessage, neutMessage,
negMessage, questType, screen):
qType = questType[screen]
print(qType) #Not giving what it should
# More code
def reservForm():
questionType = {0 : 'single', 1 : 'date', 2 : 'input', 3 : 'input',
4 : 'multi', 5 : 'single'}
reservChoice, screenID, success = choiceForm(titlePack[screenID],
choicePack[screenID], 'Suivant', 'Précédent', 'Quitter',
questionType, screenID)
# More code
On execution, i get "s" for qtype which isn't what should be there. I want to access my dictionary in the called function to be able to get the value, given an index (screenID). I read a tutorial telling about unpacking the thing with a ** operator but i didn't understand a thing. Everything worked fine before i changed my parameter in choiceForm to pass the dictionary (i was just passing one of it's value 'til i realized i'd need the whole thing for a feature i've to add)