The input () function in Python
Python's built-in input () function allows users to enter data, convert it into a string, and return the entered content.
Python's built-in input () function allows users to enter data, convert it into a string, and return the entered content.
Input function syntax ()
input([prompt])
Parameter of input function ()
input () has a unique parameter:
prompt
: is a string entered by the user.
For example
1. Input () method works in Python
# nhận input từ người dùng inputChuoi = input() print('Chuỗi đầu vào là:', inputChuoi)
Suppose the input user input is "Website TipsMake.com". Run the program, the result is:
Website TipsMake.com Chuỗi đầu vào là: Website TipsMake.com
2. Receive input from user with prompt before entering.
# nhận input từ người dùng inputChuoi = input('Nhập chuỗi:') print('Chuỗi đầu vào là:', inputChuoi)
Result:
Nhập chuỗi: Website TipsMake.com Chuỗi đầu vào là: Website TipsMake.com
See also: Built-in Python functions
Update 17 June 2019
You should read it
- The function frozenset () in Python
- The function hasattr () in Python
- Format () function in Python
- Max () function in Python
- The oct () function in Python
- The ord () function in Python
- The map () function in Python
- Sum () function in Python
- The function id () in Python
- The function set () in Python
- The next () function in Python
- Complex () function in Python
Maybe you are interested
What does the 'super slow' 7680fps movie recording feature on the Mate 30 Pro do? Hitman Sniper famous game is being free on iOS and Android How to create slow motion videos on Android? 8 ways to win people's hearts Changing these 10 ways of speaking will help you advance like 'windy kites'. 200 million year old dinosaur footprints are found in Africa