Horje
converting decimal to hex in python Code Example
converting decimal to hex in python
def convert_to_hex(number:int):
    if number == None:
        return "Invalid input"
    elif type(number) == float:
        return "Float not handled"
    elif type(number) == str:
        temp = int(number)
        return format(temp, "02x")
    return format(number, '02x')
print(convert_to_hex(30))
print(convert_to_hex(None))
print(convert_to_hex("7"))
print(convert_to_hex(7.09))
python convert hex number to decimal
print(int("61", 16)) # output 97 (ascii value "a")




Python

Related
pandas replace values based on condition Code Example pandas replace values based on condition Code Example
python - iterate with the data frame Code Example python - iterate with the data frame Code Example
rightclick in pygame Code Example rightclick in pygame Code Example
install python in centos7 Code Example install python in centos7 Code Example
how to get the mouse input in pygame Code Example how to get the mouse input in pygame Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7