Int('a') produced error why?
Answers
Answered by
8
Int('a')
Here, int() is a constructor of an Integer class and you're a assigning a char to an int variable which is impossible.
You can only assign the char code to an int variable by conversion of char to int.
Answered by
0
Answer:
in python string converted to a integer since string is a immutable type.
therefore string a cannot be converted into integer
Similar questions