Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions 100+ Python challenging programming exercises.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"


#----------------------------------------#
Expand Down