Answer to Question #240253 in Python for rai

Question #240253

1. Binary Hexadecimal Converter App

Description:


Example Output:

Welcome to the Binary/Hexadecimal Converter App


Compute binary and hexadecimal values up to the following decimal number: 12

Generating lists....complete!


Using slices, we will now show a portion of each list.

What decimal number would you like to start at: 4

What decimal number would you like to stop at: 7


Decimal values from 4 to 7:

4

5

6

7


Binary values from 4 to 7:

0b100

0b101

0b110

0b111


Hexadecimal values from 4 to 7:

0x4

0x5

0x6

0x7


Press Enter to see all values from 1 to 12.

Decimal --- Binary --- Hecadecimal


1----0b1----0x1

2----0b10----0x2

3----0b11----0x3

4----0b100----0x4

5----0b101----0x5

6----0b110----0x6

7----0b111----0x7

8----0b1000----0x8

9----0b1001----0x9

10----0b1010----0xa

11----0b1011----0xb

12----0b1100----0xc


1
Expert's answer
2021-09-22T00:02:14-0400
print("Welcome to the Binary/Hexadecimal Converter App")
N=int(input("What decimal number would you like to start at: ")) 
N1=int(input("What decimal number would you like to stop at: "))
print("Decimal values from", N, "to", N1,":")
for m in range(N,N1+1):
    print(m)
print("Binary values from",N,"to", N1 ,": ")
for x in range(N,N1+1):
    print(bin(x))
    
print("Hexadecimal values from ",N,"to", N1 ,": ")
for x in range(N,N1+1):
    print(hex(x))


print("Press Enter to see all values from 1 to 12 ")
print("Decimal --- Binary --- Hecadecimal")
for n in range(1,13):
    print(n)
print("Binary")
for x in range(1,13):
    print(bin(x))
    #print(end=" ")
#     print("--",end=" ")
print("Hexadecimal")
for m in range(1,13):
     b=[hex(m)]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS