if statements in python 3 part-7

Published: 05 January 2018
on channel: Cook The Code
3
0

What are if...else statement in Python?
Decision making is required when we want to execute a code only if a certain condition is satisfied.

example:-
If the number is positive, we print an appropriate message

num = 3
if num greater then 0:
print(num, "is a positive number.")
print("This is always printed.")

num = -1
if num greater then 0:
print(num, "is a positive number.")
print("This is also always printed.")

website:-https://coderworld109.blogspot.com/