+ 1
What is input used for in python
Well I didn’t understand it
3 ответов
+ 7
Justpython ,
the input() function is used to take input value from the user.
However This function reads input line and converts it into string and returns the text output.
For eg;
word = input()
print(word)
input :
John
Output :
John
+ 6
Justpython In Python, input() is a built-in function that allows you to get data from the user during the execution of a program. It prompts the user to enter some information (like text or numbers) and returns what they type as a string.
Here’s how it works:
Example:
name = input("Enter your name: ")
print("Hello, " + name + "!")
When the program runs, it will show Enter your name: on the screen.
The user can type something, like "Coder Kay"
The program will then store that input in the name variable, and print a message like: "Hello, Coder Kay!"
0
print(input())
It prints what you type. It's simple.