python if else elif statement

name = input('what is your name?')
if name.endswith('zd'):
print("hello panzidong")

 

 

name = input('what is your name?')
if name.endswith('zd'):
print("hello panzidong")
else:
print("hello other")

 

 

num = input('Enter a number:')
if int(num)> 0:
print('the number is positive')
elif int(num) < 0:
print('the number is negative')
else:
print('the number is zero')

 

 

posted @ 2019-06-24 17:18  嵌入式实操  阅读(443)  评论(0编辑  收藏  举报