+ 1

Any ideia? [Python]

Someone have any ideia to make this code count the kills? https://code.sololearn.com/cTDvtJSe911m/?ref=app

15th Aug 2018, 1:55 PM
I Am Arthur
I Am Arthur - avatar
4 Respuestas
+ 2
You could create a dictionary to keep count of the kills. Maybe: kills={} for x in Players: kills[x]=0 This creates dictionary with everyone’s name as a key. With each round, you end with kills[Player]+=1 which adds 1 to their kill count. And print kills at the end. This for example: https://code.sololearn.com/cag0wmmxJ4d7/?ref=app
15th Aug 2018, 2:15 PM
Russ
Russ - avatar
+ 2
Added killcounts and revamped the entire thing while I was at it https://code.sololearn.com/cLWkFJC3S806/#py let me know what you thought of it :)
15th Aug 2018, 3:54 PM
Just A Rather Ridiculously Long Username
+ 1
Russ How can i transform a int object in a position?Like: l = ["a","b","c"] And i get the position of "a", thats 0
15th Aug 2018, 3:29 PM
I Am Arthur
I Am Arthur - avatar
+ 1
I = ["a","b","c"] print(I.index("a")) #prints 0 Is that what you were after?
15th Aug 2018, 3:48 PM
Russ
Russ - avatar