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

Correct answers only please! Use the following information to find your course average in AMDM, if Homework is weighted 20%, Class Participation is 25%, Test Gr
13. What is the Virginia Plan?
HELP!!!!!!! IF I DONT PASS I WILL FAIL MY CLASS!!!!!!!!!!!!!!!!!!! Use the passage to answer the question. “Governments are instituted among Men, deriving their
Evaluate the expression for x = 2, y = -11: -11x - 4y
2.6 as a repeating decimal into a simplified fraction
In C++ the = operator indicates: equality assignment subtraction negation
(1) Suppose Sanjay has a large pile of identical black marbles and a large pile of identical orange marbles. (a) How many ways could Sanjay set up a line that i
Ricky has a science project. He wants to emphasize on the organs of the lower part of the human body. He wants to divide the body into superior and inferior reg
what is the vertex of f(x)=-x^2-8x
Compare the moment of inertia of a disk of mass 2m and radius R about its central axis to the moment of inertia of a sphere of mass m and radius 2R.