IndexPythonJapaneseChainmailleLeather

Input Function

input() - Display a message to the user, wait for their input, and store as a variable

Works exactly like print() but waits for user input and stores as a variable.

 Example:
  message = input("Hello world, how are you?")
   Hello world, how are you?
   <user input> I'm fine
  print(message)
   I'm fine

Input defaults to string type. Use int() or float() functions to convert to whole or real numbers respectively.

  message = int(input("How old are you?"))

  message = float(input("What is the value of pi?"))

HomeData TypesVariablesFunctionsEscape SequencesProgram Comments