-1

How would I accept multiple options/answers for an input. For example:

if player_ship == 'Transport' or 'TRANSPORT' or 'transport':
        print('You successfully purchased a Transport Ship!\n\n')
Chris_Rands
  • 35,097
  • 12
  • 75
  • 106
gsutton111
  • 11
  • 1
  • 3

1 Answers1

2

The below will ensure that case sensitivity is not a problem.

if player_ship.lower() == 'transport'

If you genuinely need to check against specific values, this will work:

if player_ship in {'Transport', 'TRANSPORT', 'transport'}
jpp
  • 147,904
  • 31
  • 244
  • 302