xxxxxxxxxx
var flag = true
var number = 10
if (number % 3 !=0 && number <-9 || number % 5 === 0)
{console.log(flag);} else {flag=false console.log(flag)}
xxxxxxxxxx
# Example 1: Boolean data type
x = True
y = False
print(x) # Output: True
print(y) # Output: False
# Example 2: Conditional statements
num = 10
if num > 5:
print("The number is greater than 5.")
else:
print("The number is not greater than 5.")
# Output: The number is greater than 5.
xxxxxxxxxx
a = True # dont forget capital T and F, it is case sensitive
b = False
if b == True:
print("b is true")
if b:
print("b is true") # this is the shorthand of the above IF statement
if b == False:
print("b is false") # again dont forget True and False are case sensitive
xxxxxxxxxx
if False:
# This block will not be executed because the condition is always False
print("This will not be printed.")
else:
# This block will be executed because the condition is always False.
print("This will be printed.")