0
Input vs Int Input
I'm a bit confused on these. So far I've learned that input() will bring a box for the user to input information to then be printed. What I don't understand is when you add INT to the function, it doesn't do that (at least I haven't seen in it) Is there something that I'm missing?
4 Réponses
+ 7
By default, input() take "text or string" as input.
Eg,
day = input()
print(day)
In your input box, when you input "monday" it prints "monday" as your output.
input () - does not take integer values
Whereas, int(input()) - takes only integer values. If you write any text in your int(input()) it will throw you error.
+ 7
Int() is masked over input() for getting -> integer values. So the box you get is only for input.
You have to have use int() function nested with input() then only you get output as integer.
+ 1
D Shah 🎯⏳️ This makes much more sense now! Thank you so much for helping me with all of my questions!
0
D Shah 🎯⏳️ So you won't get a box to write anythihng in with INT, only with input by itself?