can you guys please shorten this code for me...
I need to do the same thing for all 8 potions
def fightItems(yourHp, yourHpMax, heartPotion, megaHeartPotion,bloodXHealer, duelBloodXXHealer,energyYPotion, rainbowBasicHealer, attackXXXPotion, defenceXXXPotion):
while karidQuest1chooseFightOptiion == "2":
print '1. Heart Potion(',heartPotion,'remaining)'
time.sleep(0.5)
print '2. Mega Heart Potion(' , megaHeartPotion ,'remaining)'
time.sleep(0.5)
print '3. Blood X Healer(', bloodXHealer , 'remaining)'
time.sleep(0.5)
print '4. Duel Blood XX Healer(', duelBloodXXHealer, 'remaining'
time.sleep(0.5)
print '5. Energy Y Potion(', duelBloodXXHealer, 'remaining'
time.sleep(0.5)
print '6. Rainbow Basic Healer(', rainbowBasicHealer, 'remaining'
time.sleep(0.5)
print '7. Attack XXX Potion(', attackXXXPotion , 'remaining'
time.sleep(0.5)
print '8. Defence XXX Potion (', defenceXXXPotion, 'remaining'
time.sleep(0.5)
print '9. Exit'
print 'which do you use/pick'
karidFightChooseItem = raw_input()
if karidFightChooseItem == "9":
break
else:
if karidFightChooseItem == "1":
if heartPotion > 0:
heartPotion -= 1
yourHp += 25
yourHp = getMaxHp(yourHp)
print 'Heart Potion:', heartPotion
time.sleep(0.25)
print 'Your Hp:' ,yourHp
else:
print 'you have 0 heart potions'