New course! Every coder should learn Generative AI!
Try a free lesson+ 3
num=int(input(''enter the values''))
Why we are wrote int(input) why we can't write only input
3 Answers
+ 8
Laxmi
Already explained in you previous question.
I think question has been deleted.
BTW....
The Main difference is in the data type of the input.
This "int(input())" converts the user input into an integer.
while this "input()" treats the input as a string.
It depends on what you want to do with the user input..
#if you want to perform mathematical operations on the input, you would use "int(input())".
And
#If you just need the input as a string, then "input()" is sufficient.
+ 7
Because input is a string function and if we want to take integer values through input then we should convert into integer.
+ 2
"input()" itself only accepts a string. We can convert it into different variables we want