devxlogo

Convert a String to a Number in Python

Convert a String to a Number in Python

Use the int() type constructor to convert a string to number.

Sample code:

int('208') == 208

devx-admin

Share the Post: