title: How to a ValueError Input and Use It (Python 3.7)
body: <p>This is my code for my Computer Science class. I added a feature to make sure the user does not enter a non-int/float. I am trying to access what the users entry to repeat it so it goes like this:</p>
  
  <pre><code>Enter your first number:
  &gt; not_a_valid_float_or_int
  "not_a_valid_float_or_int" is not a valid number, try again.
  </code></pre>
  
  <p>So basically I am trying to replace "What you have entered" with what the user had entered.</p>
  
  <pre><code>print("Hello!\n")
  while True:
      try:
          firstnumber = float(input("Enter your first number:\n"))
      except ValueError:
          print("\nWhat you have entered is not a valid number, try again.")
      else:
          break
  print()
  while True:
      try:
          secondnumber = float(input("Enter your second number:\n"))
      except ValueError:
          print("\nWhat you have entered is not a valid number, try again.")
      else:
          break
  print("\nThe first number is:", str(firstnumber).rstrip("0").rstrip(".") , "\nThe second number is:", str(secondnumber).rstrip("0").rstrip("."), "\nThe sum is:", str(firstnumber + secondnumber).rstrip("0").rstrip("."), "\nThe product is:", str(firstnumber * secondnumber).rstrip("0").rstrip("."))
  </code></pre>
  
  <p>Thanks a lot!</p>
  
  <p>David</p>
  
  <p>P.S. please know that I am very knew to the coding scene.</p>