xxxxxxxxxx
weather == "Good!" or weather == "Great!":
# Or the following
weather in ("Good!", "Great!"):
xxxxxxxxxx
if foo == 'abc' and bar == 'bac' or zoo == '123':
# do something
xxxxxxxxxx
# if statment
#'if' gives condition in statement to make program more efficient.
a=10
b=5
if a%b==0:
print('true')
output:
true
xxxxxxxxxx
#if using or / and
name='ron'
town='Tel Aviv'
age=25
if age>18 and town=='Tel Aviv':
print(f'Name is {name} Age {age} and town is {town}\nusing and')
else:
print('other')
#answer is: Name is Ron Age 25 and town is Tel Aviv
using and
If statements in Python
xxxxxxxxxx
# Set Variables
x=1
#start if statement to check if x=1, if this is true than print 1
if x==1:
print(1)