Header Ads

Responsive Ads Here

If statement in Python

 If statement



num = 10
if num == 10: # Condition
    print("Number is 10.") # Runs when condition is true
    print("Condition is true!!") # Runs when condition is true
   
print("Hello World") # Runs whether the condition is true or false
      
                                                                   

name = "Xtra"

if name == "xtra": # Condition
    print("Name is Xtra.") # Runs when condition is true
    print("Condition is true!!") # Runs when condition is true
   
print("Hello World") # Runs whether the condition is true or false

Powered by Blogger.