diff --git a/100+ Python challenging programming exercises.txt b/100+ Python challenging programming exercises.txt index 97af5aaf..d9d12e6b 100644 --- a/100+ Python challenging programming exercises.txt +++ b/100+ Python challenging programming exercises.txt @@ -1121,6 +1121,24 @@ if s=="yes" or s=="YES" or s=="Yes": else: print "No" +#----------------------------------------# + +2.14 + +Question: +Write a program which accepts a string as input to print "Yes" if the string is "yes" or "YES" or "Yes", otherwise print "No". + +Hints: + +Use if statement to judge condition. + +Solution +s = raw_input() +lower_case = s.lower() +if lower_case == 'yes': + print "Yes" +else: + print "No" #----------------------------------------#