[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Anyone who has the time to help with some Python?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 4

File: opengraph-icon-200x200.png (8KB, 200x200px) Image search: [Google]
opengraph-icon-200x200.png
8KB, 200x200px
Anyone who has the time to help with some Python?
>>
>>8630637
Normally I'd tell you to go to >>>/g/ but there's been too many Trump/AGW denialism threads recently. So shoot.
>>
>>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
Thread posts: 10
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.