Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 430 Bytes

File metadata and controls

12 lines (7 loc) · 430 Bytes

Reading text from the keyboard

The input function

Text can be read from the keyboard with the input function. input works with and without a message text. The value returned is always a string:

:::python
a = input()
b = input('Please enter a number')

Although the input command is rarely seen in big programs, it often helps to write small, understandable programs, especially while learning Python.