+ 5
int ("2"+"3")
why the answer is 23. I was thought that the answer is 5.
7 Answers
+ 7
the bracket or parenthesis operation is to be performed first i.e ("2"+"3") which is ("23") and still a string type...then int("23") will convert "23" to 23 which is now an integer data type
+ 6
int('2') + int('3') = 5
+ 5
"2â is a string and â3â is a string, so â2â + â3â = â23â because itâs not a number itâs a string. However, 2 is an integer and 3 is an integer, so 2 + 3 = 5
+ 4
You first do "2"+"3"="23" and next int("23")=23
+ 3
The operations inside the parenthesed are operated before calling the int constructor.
+ 2
"2" and "3" are strings so they will concatenate and therefore become 23
+ 2
Type ("2")>>>str #Cadena
Type ("3")>>>str #Cadena
ConcatenaciĂłn:
"2"+"3"="23"
type(int("23")) >>>int #Entero