How to convert hexadecimal to decimal in Python

2 Answers

0 votes
s = '0xf1c3'

d = int(s, 16)

print(d)



'''
run:

61891

'''

 



answered Apr 30, 2021 by avibootz
0 votes
import ast

d = ast.literal_eval('0xf1c3')

print(d)




'''
run:

61891

'''

 



answered Apr 30, 2021 by avibootz

Related questions

1 answer 118 views
1 answer 186 views
1 answer 94 views
1 answer 102 views
1 answer 97 views
...