6. Summary

  • The input() function asks the user to type something, and Python waits until they do.
  • Use the prompt parameter, for example input("Enter your name:"), to show a message on the same line as the input.
  • You can use as many input() calls as you need.
  • Input is always treated as a string. Use float() to convert it into a number.
  • Validate input with try and except inside a while loop so the program does not crash on wrong input.