Computer Science, asked by kanishka29007, 1 year ago

Int('a') produced error why?

Answers

Answered by Anonymous
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 BlessyThomas
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