Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python of if...else

# Program checks if the number is positive or negative
# And displays an appropriate message

num = 3

# Try these two variations as well. 
# num = -5
# num = 0

if num >= 0:
    print("Positive or Zero")
else:
    print("Negative number")
Source by anh.cs.luc.edu #
 
PREVIOUS NEXT
Tagged: #Python
ADD COMMENT
Topic
Name
4+9 =