+ 1

What is input used for in python

Well I didn’t understand it

1st Dec 2024, 9:49 AM
Willxdev
Willxdev - avatar
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
1st Dec 2024, 9:53 AM
Suparna Das
Suparna Das - avatar
+ 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!"
1st Dec 2024, 10:25 AM
Coder Kay
Coder Kay - avatar
+ 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...
2nd Dec 2024, 8:47 PM
Riya
Riya - avatar
+ 1
stacey marshall , Diana Peters , your posts are reported as spam.
11th Dec 2024, 9:15 PM
Lothar
Lothar - avatar
0
print(input()) It prints what you type. It's simple.
2nd Dec 2024, 11:33 AM
The Big Cheese 1211-1967
The Big Cheese 1211-1967 - avatar
0
Thanks for making my work a lot easier. your post are appreciated https://www.starbucks-partnerhour.com
10th Dec 2024, 4:30 AM
Diana Peters
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
10th Dec 2024, 6:28 AM
stacey marshall