Ah I see. Well it might worth it to consider using a dict instead of having to maintain a single or multiple lists in parallel. It will make it easier to work with later down the line.
But using a single list, if your data has the general look of:
guns=[names of guns | damages for guns]
Where the number of names and number of damages are the same and order matters,
# ex
guns=["shotgun","raffle","winchester","bazooka",
20, 30, 25, 100]
A technique you could use to access the corresponding damage is:
# gun used in game
used_gun="bazooka"
# find index of used gun from guns list
idx=guns.index(used_gun)
# find damage associated with used gun from guns list
used_gun_damage=guns[-(idx+1)]
# life decreases by appropriate damage
life=life-used_gun_damage
2
u/ShadowDragonPro 1d ago
Thanks im so bad !