Hi. I busy going through practice problem sets my teacher gave me... for some re
ID: 649327 • Letter: H
Question
Hi. I busy going through practice problem sets my teacher gave me... for some reason I'm really struggling with these two questions... Thanks:
Write a Python module called 'bukiyip.py' with the following functions for simple Bukiyip arithmetic, assuming that all values have at most 3 digits.
? bukiyip_to_decimal(a) Convert a Bukiyip number to decimal.
? decimal_to_bukiyip(a) Convert a decimal number to Bukiyip.
? bukiyip_add(a, b) Add two Bukiyip numbers.
? bukiyip_multiply(a, b) Multiply two Bukiyip numbers.
Sample I/O:
**** Bukiyip test program ****
Available commands: d : convert given decimal number to base-3.
b : convert given base-3 number to decimal.
a : add the given base-3 numbers.
m : multiply the given base-3 numbers.
q : quit
Enter a command: d 12 110
Enter a command: b 20 6
Enter a command: a 12 11 100
Enter a command: m 12 11 202
Enter a command: q
Explanation / Answer
hope this may helps you...
print("Enter two Numbers ")
a = int(raw_input('A='))
b = int(raw_input('B='))
c=a+b
print ('C= %s' %c)
raw_input() # waits for you to press enter
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.