fjsmith7166 fjsmith7166
  • 09-11-2017
  • Computers and Technology
contestada

Write a program that reads a floating-point number from the user and prints "zero", "positive" or "negative"

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 10-11-2017
```
#!/usr/local/bin/python3

foo = float( input( "Enter a number: " ) )
if( foo < 0.0 ):
    print( "negative" )
elif( foo > 0.0 ):
    print( "positive" )
else
    print( "zero" )

exit( 0 )
```

Answer Link

Otras preguntas

Which states would most likely support a system in which the number of votes each state had in the nation's legislature was based on the population?why?
Which equation has the same solution as x^2-6x-13=0? A.) (x+3)^2=21 B.) (x-3)^2=21 C.) (x+3)^2=3 D.) (x-3)^2=3 Explanation?
Solve for the variable h. f=12gh h=?
Why are SI units helpful for describing objects?
The weight of an object is the product of its mass, m, and the acceleration of gravity, g (where g=9.8 m/s2). If an object’s mass is m=10. kg, what is its weigh
what are some spanish words that start with x
what is a word for not perfect having defect
Subtracting a number from 30 gives the same result as adding the number to 18. What is the number?
what other expression is equivalent as 8x6?
Solve the equation for y. 6x-3y=18