This is my code:
import random
stats=[]
attributes=5
print("Stats:", end=" ")
for i in range(attributes):
r=random.randint(40,70)
stats.append(r)
print(stats[i], end=" ")
print('''
\t[1]- Strength
\t[2]- Dexterity
\t[3]- Intelligence
\t[4]- Wisdom
\t[5]- Charisma
''')
select = int(input("Select: "))
select -= 1
stats[select] += random.randint(10,15)
for i in range(len(stats)):
if i==select:
continue
stats[i] -= random.randint(10,15)
print(f'''New Stats is: {stats}''', end= " ")
#Fireball
fireball=[12, 15, 28, 10, 5]
skill=input("\nChoose One Of Four Skills: ")
if skill=="F" or "f":
stats[i] -= fireball[i]
if stats[i]>0:
print(stats)
#After this there should be 3 more similar ones (Like same but for lightning).
#Lightning
#Silence
#Fire Ward
With this code I get for example this output:
Stats: 65 48 48 42 41
[1]- Strength
[2]- Dexterity
[3]- Intelligence
[4]- Wisdom
[5]- Charisma
Select: 3
New Stats is: [54, 36, 59, 29, 26]
Choose One Of Four Skills: f
[54, 36, 59, 29, 21]
However, what I expect to see in the last lines are:
Choose One Of Four Skills: f
[42, 21, 28, 19, 16]
As per my knowledge, a list should be decreased by a value in my list fireball in these lines:
if skill=="F" or "f":
stats[i] -= fireball[i]
Can anyone please explain to me why I am getting the same list? I tried to add [i] in the last line (which is: print(stats)), but in that case, it shows only one value.