title: How do you get Python to detect for no input
body: <p>I'm new to coding in python and I was filling out some code that required a number of inputs. One thing it asked for was for the program to perform an action if the user pressed the enter key and did not type in any input. My question is how you would get python to check for that. Would it be:</p>
  
  <pre><code>if input == "":
      #action
  </code></pre>
  
  <p>Or is it something else? Thank you for the help.</p>
  
  <p>Edit: Here is what my code currently looks like for reference.</p>
  
  <pre><code> try:
       coinN= int(input("Enter next coin: "))
  
       if coinN == "" and totalcoin == rand: 
           print("Congratulations. Your calculations were a success.")
       if coinN == "" and totalcoin &lt; rand:
           print("I'm sorry. You only entered",totalcoin,"cents.")  
  
   except ValueError:
       print("Invalid Input")
   else:
       totalcoin = totalcoin + coinN
  </code></pre>