uwaismohammed46
uwaismohammed46 uwaismohammed46
  • 25-02-2021
  • Computers and Technology
contestada

write a python program to convert a number entered by the user
the input is 985
the output is Nine Eight Five

Respuesta :

ooo510125
ooo510125 ooo510125
  • 25-02-2021

Answer:

# Function to convert decimal number

# to binary using recursion

def DecimalToBinary(num):

if num >= 1:

DecimalToBinary(num // 2)

print(num % 2, end = '')

# Driver Code

if __name__ == '__main__':

# decimal value

dec_val = 24

# Calling function

DecimalToBinary(dec_val)

Explanation:

Answer Link

Otras preguntas

how to undo the operation and explain why it works a. adding 28 b. dividing by 17
how to undo the operation and explain why it works a. adding 28 b. dividing by 17
A golf ball is dropped from rest from a height of 9.5m.  It hits the pavement then bounces back up rising  just 5.7 m before falling back down again.  A boy the
I have this sentence that I have to rewrite using a possessive nounThe swimming pool at the athletic center. Please help
what is the answer to 3p-5>2p+p-7
A 100 centimeter stick broke into 3 pieces one piece was 7 centimeters long and another was 34 centimeters long how long was the third piece
How do I solve this problem 7x<14 and 1-x<4
Which mathematical sentence most accurately expresses the information in the problem below? Crystal has 100 compact discs that she wants to put into boxes each
homophones for the words insignificant and small.  has to be 5 letters
which expression stands for 32 more than a number d