2271737281 2271737281
  • 26-01-2022
  • Computers and Technology
contestada

Write a program that accepts a number as input and prints just the decimal portion. This
program should run with numbers with decimals and numbers without decimals.

Respuesta :

s906236
s906236 s906236
  • 26-01-2022

Answer:

Let's code it using python. We can take care of the negative number by placing an absolute function at the end. Basically the decimal part is calculated by subtracting the integer part from the original input number

def decimal_print(number):

   int_part = int(number)

   decimal_part = number - int_part

   return abs(decimal_part)

Explanation:

Answer Link

Otras preguntas

medicines that are prescribed to kill microbial infections presend in the body are called​
What is an issue with using cloud computing? -keeping information and date safe -keeping information and data separate -keeping connections available -all of th
If p is a true statement and q is false, then p q is true. True False
Why are fingertips wet with saliva before counting money?​
Fill in the blank with the correct sign >, < , or = -3/4 -4/5
This is the poem resisting arrest and I need help
Somebody help me so I can give y’all some points
1 Ryan... his electricity bill yet. A hasn't paid C doesn't pay B hasn't been paying D not paying 2 Andrea ... her homework since noon. A has done C is doing B
can you please help me with this.
Which type of fats insulate the body, protect organs, and provide energy, are necessary for good health? Group of answer choices unhealthy essential unsaturated