Skip to content Skip to sidebar Skip to footer

Python If With Many Or In A Contracted Form

I'm learning python and I found myself lost trying to create a an if statement that should be true if the user input y or yes. #!/usr/bin/env python3 user_input = input('Would y

Solution 1:

Change it to

if lowui in('y', 'yes'):

Also this is wrong:

lowui = user_input.lower

it should be:

lowui = user_input.lower() # Actually call the lower function

Post a Comment for "Python If With Many Or In A Contracted Form"