-3

So I'm doing a project where you put an input and once you do it matches one of cube, pyramid, ellipsoid, quit or it goes back to the original question

I want the user to be able to input any of those words in whatever uppercase or lowercase possible, so an example would be I'd want cUbe or cubE to do the same thing as cube

while True:
    shape = input("What shape would you like?: ")

    if (shape == "cube" ) : #Calculating cube volume
        cube_func()
        continue

1 Answers1

2

you can use the shape.lower() it converts a string to lower case.

while True:
    shape = input("What shape would you like?: ")

    if (shape.lower() == "cube" ) : #Calculating cube volume
        cube_func()
        continue
OmO Walker
  • 611
  • 6
  • 13