1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vanyuwa [196]
4 years ago
11

Write a program named CheckMonth that prompts a user to enter a birth month. If the value entered is greater than 12 or less tha

n 1, display the error message Invalid month; otherwise, display the valid month with a message such as 3 is a valid month.
Computers and Technology
1 answer:
klemol [59]4 years ago
3 0

Answer:

Program:

month=['January', 'Februrary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] #list which stores the name of the month.

CheckMonth= int(input("Enter the number of the month")) #it is used to take the inputs from the user.

if CheckMonth>=1 and CheckMonth<=12: #check the condition for valid month.

   print(str(CheckMonth)+" is a valid month which name is: "+ str (month [CheckMonth-1])) #print the name of month which is enter by the user.

else:

   print(str(CheckMonth)+" is not a valid month, please enter the valid month") # print for the invalid month.

Output:

  • If the user inputs 1, it will prints "1 is a valid month which name is: January".
  • If the user inputs is 0, then it will prints "0 is not a valid month, please enter the valid month"

Explanation:

  • The above program is in python language, in which the first line of the code is used to hold the list of the month.
  • Then the second line is used to render a message for the user input, take the input from the user and save it into a variable.
  • Then that value is checked by the if-condition that it lies in between 1 to 12 or not.
  • If it lies, then print the valid month otherwise it prints that the month is invalid.
You might be interested in
Chuck plans to go on a hiking trip. Before the hiking trip, Chuck's bank account has $129.50. He then spends $129.50 on hiking g
iragen [17]

Chuck plans to go on a hiking trip. Before the hiking trip ...

Aug 18, 2011 · Hiking Yellowstone National Park ... and though I only had 48 hours to spend in the park this trip, I tried to make the most of it. I drove the entire 152 mile Grand Loop circle, stopping

3 0
3 years ago
The ______ view connects perceptual capabilities to information available in the world of the perceiver. Multiple choice questio
jekas [21]

Answer:

Ecological

Explanation:

Please mark brainliest

4 0
2 years ago
g Returns the contents of the list as a new array, with elements in the same order they appear in the list. The length of the ar
natali 33 [55]

Answer:

Find the attached picture

Explanation:

Attached picture contains the Python function which takes a list as argument and returns a new list with same size and elements in same order.

3 0
3 years ago
Write an algorithm to get the value of length and breadth of a rectangle from the user and find its area. inn qbasic
Shalnov [3]

Answer:

IN PYTHON ::

x=int(input('Enter length:'))

y=int(input('Enter width:'))

print('Area of the rectangle is', x*y,'squared units')

I hope it will be useful.

5 0
3 years ago
How do i block somebody on here, theyre making me have a panic attack. /srs
spin [16.1K]

Answer:

If someone is disturbing you a lo then you can report him/her.

  • Go to g-mail.
  • Type a message to US Support.
  • Add a screenshot of him/her whom you want to report.
  • Use polite words
  • At last, send it.

You will get soon response.

5 0
3 years ago
Read 2 more answers
Other questions:
  • One of the essential skills that software development engineers must have is the proficiency in at least one of the modern compu
    6·1 answer
  • Comparing tools made of stone, iron, and bronze: place them in the correct order from least to most durable
    14·1 answer
  • What is the purpose of system calls, and how do system calls relate to the OS and to the concept of dual-mode (kernel-mode and u
    14·1 answer
  • In an image citation, what piece of information is listed first?
    14·1 answer
  • The benefits for a cad proram is: (points : 2) 1 accuracy 2 repeatability 3 simplicity 4 all of the above
    9·1 answer
  • Which hexadecimal number is equivalent to the decimal number 11?
    13·1 answer
  • What are QBASIC Operators ?​
    11·2 answers
  • Along a road lies a odd number of stones placed at intervals of 10 metres. These stones have to be assembled around the middle s
    12·1 answer
  • And tags are examples of stand - alone tags.
    15·1 answer
  • Assume that you have 22 slices of pizza and 7 friends that are going to share it (you've already eaten). There's been some argum
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!