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 of the following best describes why late 20th-century communist command economies declined? Government central planning restricted incentives for innovati
If you walk through an area with mosses and ferns, you are seeing ________.
Which event caused American schools to place a greater emphasis on science and math courses in the 1950s and 60s? A the Korean War B The Space Race C The Vietna
One of the main ideas of Jacksonian democracy was the expansion of suffrage. By the time Jackson was elected to his second term in 1832, suffrage had expanded t
what are fatty acids chains
Identify the strongest attractive force present in the pure substances shown: london forces, dipole-dipole, hydrogen bonding, ion-dipole, or ionic attractions.
A toy car has a 1.5 A current, and its resistance is 2 Ω. How much voltage does the car require?
After drawing a line segment and placing the compass' point on one endpoint of the segment, what is the next step in constructing the segment's perpendicular bi
Why can sunlight be blinding when it shines on snow
The Endosymbiotic theory states that chloroplast and mitochondria evolved as a result of