☞ It is used to execute one block of code if the condition is true, and another block of code if the condition is false.
Syntax :
if <test_condition>:
Statement_1
Statement_2
……….
else:
Statement_1
Statement_2
……….
x = int(input("Enter a number : "))
if x>=0:
print("Positive Number")
else:
print("Negative Number")
Enter a number : -6 Negative Number