Can we use input instead of print in python all the time? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we use input instead of print in python all the time?

9th Apr 2018, 8:35 PM
ayush goel
ayush goel - avatar
7 Answers
+ 8
ayush goel I'd recommend you to check this out: https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2426/ And also to do the whole Python course here: https://www.sololearn.com/learn/Python/
9th Apr 2018, 8:54 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
Nope. Input is for the user to enter the data. Print is for outputting this data :)
9th Apr 2018, 8:46 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
well you might have a program that will add names into a list manually you might have input, but it doesn't necessarily show what you've written, if you need to see what you've written into the program you'd use print a = list() b = input("What is your name") # takes user input a.append(b) # and adds it to a list print(a) # and prints what name has been added to the list print shows X data from the code, where input is by default a string variable that will be given by the user when the code runs
9th Apr 2018, 8:58 PM
Markus Kaleton
Markus Kaleton - avatar
0
so, where i can use input
9th Apr 2018, 8:48 PM
ayush goel
ayush goel - avatar
0
if you need user input you use input, you can use it anywhere if you need it to get data from user
9th Apr 2018, 8:50 PM
Markus Kaleton
Markus Kaleton - avatar
0
could you explain it with an example
9th Apr 2018, 8:51 PM
ayush goel
ayush goel - avatar
0
OK
9th Apr 2018, 9:01 PM
ayush goel
ayush goel - avatar