0
why we need to type cast
2 Answers
0
Because there is no strict typing in Python (f.e. the same variable may give you an access to integer value, and right after that you may assign it to string). So in Python type of variable depends on type of expression it is assigned to, and we need to make conversion explicitly, to make sure this type is one we need.
w = "1" # w is string
w = int("1") # w is int
0
ho k thank u