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')

 

 

Guess you like

Origin www.cnblogs.com/lianghong881018/p/11078246.html