Wednesday, June 19, 2019

if and else loops in python

s = input ("Input your name: ")
if s == "Tom":
    print("Hello ", s)
else:
    print("Hello unknown")

output:


note:

after if and else statements ":" is mandatory ,other wise compiler gives an error

No comments:

Post a Comment

python class topic video