0

I'm still pretty new to python and I'm writing a text based adventure and i need it to run a loop if one of 3 things are said like if class== 'warrior','mage','ranger':

import time
import random

#min and max
lmin=9
lmax=15
hmin=21
hmax=35
#randome light
lattk=random.randint(lmin,lmax)
#random heavy
hattk=random.randint(hmin,hmax)
#level
lvl=1
#xp
xp=0

playing=1
if playing==1:
    print('Hello user\n What shall i call you?')
    user=str(input(''))
    print('Hello',user,'Welcome to TAP')
    print('To start your adventure please choose a class')
    print('Warrior\nMage\nRanger')
    userClass=str(input(''))
    if userClass=='warrior','mage','ranger':        #<-------------------problem
        print('Ah the',userClass,'a very wise choice')
        print('Now its time to pick a starter weapon\nYou have 3 choices:')
        if userClass=='warrior':
            print('Mace\nSwoard\nAxe')
            weapon=str(input(''))
            if weapon=='mace':
                print('the mace does 14-25 attack dmg')6
            elif weapon=='sword':
                print('The sword does 12-26 damage')
            elif weapon=='axe':
                print('The axe does 16-24')
            else:
                print('Sorry',weapon,'is not a valid weapon')
    else:
        print('Please input a valid class')
Remi Guan
  • 21,506
  • 17
  • 64
  • 87

0 Answers0