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

0.02 is 10 times 0.2. true or false
Bryce is reading a passage from his favorite story. He finds the story humorous because of the deliberate exaggeration. The writer describes people, things, or
find the missing part of the unit rate: $6.50/2 lbs = ?$ / lb
In 1855, Italian governments were controlled by either _________ or the papacy. a. Austria b. Italy c. Germany d. Spain
what is the answer? x^2 + 4x - 6 = 0
According to the Constitution, which of the following is a requirement to be a candidate for president? a. to be a senator, representative, or governor b. to be
What is an extended metaphor? a. a metaphor that makes a comparison by using the words “like” or “as” b. a metaphor that sustains the comparison for several lin
The water cycle is also referred to as the _______ cycle. a. oxygen b. hydrogen c. watershed d. hydrologic
Which of the following is true about the draft lottery? It was based on one's birth date. It eliminated college deferments. It kept the draft for ten more years
In choosing a topic for a speech, you should always consider whether it is _____________ and _____________ . a. appropriate; interesting b. narrow; interestin