Jump to content
5 minutes ago, Wictorian said:

If input is enter, I wanna skip, else I wanna execute some code. How can I do this?

userInput = input()
if(len(userInput)):
    # userInput isn't empty, do your stuff here.
    # userInput will be empty, if user just simply pressed Enter, in which case this stuff never happens.
    print(userInput)

 

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
https://linustechtips.com/topic/1284957-pyhton-input/#findComment-14328474
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×