For example, I have a
String = "TGR1UK"
I only need the number 1 in the string to do some math operation so I make a number variable as
number = String[3]
but the type of this "number" is actually Char and I cant use
number = (int)String[3]
to cast it into an integer
what should I do?
number = (int)String[3]would raise a syntax error. Why aren't you calling theintfunction? It looks like you are trying to do a C-like cast. Python is not C, there are no casts