I\'ve come across links that say Python is a strongly typed language.
However, I thought in strongly typed languages you couldn\'t do this:
bob = 1
b
Python typing is Dynamic so you can change a string variable to an int
x = 'somestring'
x = 50
Python typing is Strong so you can't merge types:
'foo' + 3 --> TypeError: cannot concatenate 'str' and 'int' objects
In weakly-typed Javascript this happens...
'foo'+3 = 'foo3'
Java forces you to explicitly declare your object types
int x = 50;
Kotlin uses inference to realize it's an int
x = 50
But because both languages use static types, x
can't be changed from an int
. Neither language would allow a dynamic change like
x = 50
x = 'now a string'