Can anyone tell me what's d use of this int function?
One can simply do 2+3 why wud someone try to do int('2'+'3')?
Because when you are receiving input you may have the variables be strings and then have to do operations on them
user inputs are by nature strings, so sometimes converting is necessary in order to execute arithmetic operations
some times you as output not an integer, and you must convert what you have
a="5" b="6" print (a+b) print (int (a)+int (b)) o/p - 56 11 if u r using any no. as string in any variable then to calculate it as string u can simply write it in print () but to manipulate it as integer int () is used .
Without using the 'Int' you cannot operate mathamatical operations
To convert concated string '23' to integer 23 so we can perform mathatical operations on it.
bcoz u may require strings and numerals at the same time consequitively one after another.