0
units = input('Is your data in km/h or m/s: ')
if units == 'km/h' or 'KM/H' or 'Km/h' or 'kM/h' or 'km/H' or 'Km/H' or 'kM/h': 
    initialV = float(input('Enter the initial velocity:')) 
    finalV = float(input('Enter the final velocity: ')) 
    deltaV = (initialV-finalV)

I want my code to, if the user inputs m/s for the units, to skip the indented code above, however, it doesn't seem to be happening as when running it, despite me putting m/s in the input, still, runs the above code.

Jack
  • 13
  • 1

1 Answers1

0

You have to put the whole expression with "or".

if units == 'km/h' or units == 'KM/H' or units == 'Km/h' or units == 'kM/h' or units == 'km/H' or units == 'Km/H' or units == 'kM/h':
MalloyDelacroix
  • 2,193
  • 1
  • 13
  • 17