python convert string to integer in base
int(x, base=10)
>>> int('s',base=29)
28
python convert string to integer in base
int(x, base=10)
>>> int('s',base=29)
28
python convert string to int
# this is a string
a = "12345"
# use int() to convert to integer
b = int(a)
# if string cannot be converted to integer,
a = "This cannot be converted to an integer"
b = int(a) # the interpreter raises ValueError
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us