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

Rio grande river separates what Texas city from Mexico starts with E
What is the difference between preterite and imperfect and the past progressive and present progressive?
Rio grande river separates what Texas city from Mexico starts with E
How do you tell if an equation is linear or not????
How do you think the world was created?
Water on each side of a divide flows in...
Water on each side of a divide flows in...
Which statement illustrates the distributive property? Please help
Rio grande river separates what Texas city from Mexico starts with E
How do you tell if an equation is linear or not????