Write a Program to Print Yes if the string is Yes or Print No

Question:

Write a program that accepts a string as the input to print “Yes” if the string is “yes” or “YES” or “Yes”, otherwise print “No”.

Hints:

  • Use the if statement to judge the condition.

Solution:

s= raw_input()
if s=="yes" or s=="YES" or s=="Yes":
    print "Yes"
else:
    print "No"
Code language: Python (python)

Leave a Comment