Python Forum

Full Version: given 2 base 20 numbers write a program to subtract second from the first and return
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Assume a base 20 number system which uses symbols 0-9 to represent values zero to nine and charectera A-J to represent values ten to nineteenth.

As an example the base 20 number 1JF3 can be written as
(1*20 power 3) + (J*20 power 2)+(F*20 power 1)+ (3*20 power 0)
This evaluates to 1*8000 + 19*400+ 15*20 + 3*1 = 15903 in decimalsystem

given 2 base 20 numbers write a program to subtract second from the first and return the result in base 20 format.

Need the python cide

Can anyone please help me out
Looks like a homework to me, so I moved the thread to the respective section of the forum.
We are glad to help, but we are not going to do your work for you. Please, show us your best attempt at the code and asl specific questions regarding issues you can not solve yourself.
Try it. If your attempt doesn't work, share your code and the error you get, along with your output, and the expected output, and we'll help you along the way. But we won't just do it for you.