Mode Gelap

Recent in Fashion

Best Seller Books

May to August

  • Problem Description

    The length of a month varies from 30 and 31 days. 

    In this exercise you will create a program that reads the name of a month from the user as a string. 

    The program should get input from May to August.

    If the input is from may to other months then display error messages as "Invalid"

    Note:
    Use only if and elif
  • CODING ARENA
  • month=input()
    if(month=="Jun"):
        print("30")
    elif (month=="May","July","Aug"):
        print("31")
    else:
        ("Invalid")

  • Test Case 1

    Input (stdin)
    May

    Expected Output
    31
  • Test Case 2

    Input (stdin)
    Jun

    Expected Output
    30

Subscribe Our Newsletter

avatar
"By speaking behind my back, it means that you respect my existence enough not to act in front of my face."

Related Posts

0 Comment

Post a Comment

Article Top Ads

Parallax Ads

Article Center Ads

Article Bottom Ads