+ 1
What is input used for in python
Well I didn’t understand it
7 Respostas
+ 9
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!"
+ 2
Justpython ,
input() statement is to get user input in python...
Which is defaultly makes you to give string as a input...
If you give,
----> print(input())...it will
automatically trigger you to
give string as input...
----> print(int(input())... here int()
will convert the string into an
integer...
----> print(float(input())... here float() will convert the string into decimal number...
You can use the input statement according to your problem statement...
+ 1
stacey marshall , Diana Peters ,
your posts are reported as spam.
0
print(input())
It prints what you type. It's simple.
0
Thanks for making my work a lot easier. your post are appreciated https://www.starbucks-partnerhour.com
0
Enjoyed reading the article above, really explains everything in detail, and the article is very interesting and effective. Thank you and good luck with the upcoming articles. https://www.firstprogress.net