def dec_to_hexa(dec): d = int(dec) #d represents decimal print(d, " in Hexadecimal : ", hex(d)) # Prints equivalent decimal #____main____ dec=int(input("Please enter a number: ")) dec_to_hexa(dec) Output 1: Please enter a decimal number: 1234 1234 in Hexadecimal : 0x4d2 Output 2: Please enter a decimal number: 33 33 in Hexadecimal : 0x21
इन्हें भी देखें।
- while loop
- for loop
- nested loops
- loop control statements (Break, Continue, Pass)
- if statement
- if-else statement
- if-elif statement
- nested if statement
- range() function
- keywords
- Identifiers (names)
- Literals
- Operators
- punctuatorts
Python Programs के लिये यहाँ click करें।