Thursday, March 12, 2020

if and else in python language


x=50
y=50

if x>=0 and x<= 100 and y>=25 and y<=250 :
    print("player is inside the area.sound the alarm")
else:
    print("player is outside  the area. Do  nothing")

output:
player is inside the area.sound the alarm


example2:
israining=True
issunny=True
if israining and issunny:
    print("sun showers")

output:
sun showers

No comments:

Post a Comment

python class topic video