121k views
17 votes
Can somebody do an Algorithm 2 for more?
(Python)

Can somebody do an Algorithm 2 for more? (Python)-example-1

1 Answer

5 votes

# If the number is positive, we print an appropriate message, else we print the opposite

num = 3

if num > 0:

print(num, "is a positive number.")

num = -1

elif num < 0:

print(num, "is a negative number.")

num = 0

else

print(num, "is neither positive nor negative.")

User Rcs
by
5.7k points