In int(), you can specify the true value for the second factor.
str1 = "0xf"
str2 = "f"
print(int(("0xf", 0)) #prefix(0x) - automatically finds the type if the second factor is 0
print(int(("f", 16)) #If prefix does not exist - must be specified
© 2024 OneMinuteCode. All rights reserved.