Validated user input (ensure correct/expected data entry)

--Originally published at angelmendozas

To ensure the expected entry is correct you need to use a nested statement, so the program ensures the user input is exactly how you want it (well…the program).

Captura de pantalla 2016-11-07 a las 17.45.52.png

The program uses float bc there can be a positive or negative number in the input, then allows the user to write something with the input function, then as the comment says, it checks if the number is positive, negative or zero and prints whatever it is depending on the input.