7
I am new to Python and a question came to me when solving exercise 1001 of Uri Online (read A and B, assign sum to X and print), when writing the following code, I received the concatenation:
a = input()
b = input()
x = a + b
print ("x = ", x)
when exchanging input() for int(input()) for each of the variables, I get the sum. From what I understand, if I do not declare anything in the input, by default the received type will be a string. I’m used to Java, where it is always necessary to declare the type of the variable. I would like you to explain how the Python typing works.
in python it is not necessary to declare the type of the variable as it is automatically assigned you can try a data type conversion
– user45474