-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
  • 38,994
  • 14
  • 83
  • 119
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
  • 159,742
  • 34
  • 281
  • 339