Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Read a number and say if it is positive, negative or zero.
Check the two special cases, and let else catch the last one.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
Plan. Again three cases.
if n > 0: shows positive.elif n < 0: shows negative.else: the number must be 0, so it shows zero.Check. For it shows negative. For it shows zero.
Log in to join the discussion.
Loading…