ScanSkill

input

This input() function takes input from the user and returns it.

Syntax

input([prompt])

Here,

  • prompt: Optional. A string without trailing newline

Examples

  • General use cases
>>> input()
This is a test message.
'This is a test message.'

>>> # With a prompt message
>>> input('Enter your message: ')
Enter your message: Hello, this is a test message.
'Hello, this is a test message.'