Ask coding questions

← Back to all posts
How do you check the user inputted the correct letters (any manner) so that I can change it to upper
Akshaad90

I'm checking if the user inputted the correct letters (it can be in any manner), so that I can change it to upper at the end (I am using an if statement).
Please help.
Thank you.

Voters
Akshaad90
Comments
hotnewtop
IMayBeMe

Just do, user_input.upper()

Akshaad90

@IMayBeMe, thanks for your suggestion, but that's not what I'm looking for. What I'm looking for is that I want to handle anyway the user types something. For example, lets say that we want the user to type "apple". The user could type "APPle", "applE", "apPLE", etc. Is there a function to do that?

IMayBeMe

@Akshaad90 well by converting everything to uppercase or lowercase, you can only check for one string.