+ 1
Any ideia? [Python]
Someone have any ideia to make this code count the kills? https://code.sololearn.com/cTDvtJSe911m/?ref=app
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
+ 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 :)
+ 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
+ 1
I = ["a","b","c"]
print(I.index("a")) #prints 0
Is that what you were after?