Anyone who has the time to help with some Python?
>>8630661
going to post a screenshot but first gonna try to explain it
i have a dictianry with multible values for every key and i need to write a function that will go through every key and then value and then put every individual value through a simple letterscrambler.
when thats done the program should make a new list with the same keys but new values...
hard to understand i know but maybe the screenshot will help
>>8630661
here ya go.
i've fucked up the return line but what about the rest
If you iterate over a dict, you're iterating over the keys in an unordered fashion. For each key, you can extract the value and then assign it to a new variable. Then, you can iterate over your variable. Assign key value pairs to an output dictionary as you go.
Ex:
output ={}
for eachKey in yourDict:
----currentVal = yourDict[eachKey]
----for eachPos in range (0,len(currentVal)):
--------currentVal[eachPos] = scrambleFunc(currentVal[eachPos])
----output[eachKey] = currentVal
>>8630678
makes sense. thanks, ill get back to you if im too retarded to write it correctly
>>8630678
bare in mind i have literally been doing this for a week!
what am i missing now?
>>8630678
error message that is printing now
>>8630661
this is a good point, and makes me wish we could do code blocks in /sci/ like we can in /g/
maybe there is a way to get similar formatting using TeX?
>>8630725
switch your code around so that bandit() is defined first