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

What chemical equation sums up the events of photosynthesis?
which Italian city conquered Greece and adopted many Greek ways?
How do I find this answer 20=4x
Why was it difficult for farmers and cattlemen to get along?
how did militarism contribute to increased imperialism
When light energy excites electrons in photosystem II, where do the electrons to replace them come from?
What factors will increase the amount of energy by kinetic
In Mexico _____ is celebrated by processions from the 16 of December until Christmas Eve to represent the journey of Mary and Joseph to Bethlehem.
would you expect hydrogen chloride to be a gas , liquid ,or a solid at room temp and pressure ? explain your answer ( its a 3 mark so dont explain it that much
Can someone please help me with this ? What is the change in elevation from 134 feet below sea level to 29 feet above sea level? possible choice are ; , -163