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 110 views
1 answer 172 views
1 answer 81 views
1 answer 89 views
1 answer 90 views
...