how typecast string to int in python?

how to read a string value as an integer in python? for eg if a=['1','2'] where 1 and 2 are characters. but these values are needed as integers for further operations like finding prime numbers between them

Your Answer

Read all the entries of a list and use the function int(string) to convert string type numbers into int For example a=['1','2'] K=[] for i in a: K.append(int(i)) I hope i cleared your doubt

Python

Didn't get the answer.
Contact people of Talent-Python directly by clicking here