Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Add ta Exercise# 3: Write a program that asks the user to enter a month (1 for January, 2 for February, and so on)

image text in transcribed

python

Add ta Exercise# 3: Write a program that asks the user to enter a month (1 for January, 2 for February, and so on) and then prints the number of days in the month. For February, print "28 or 29 days". - Enter a month:5 30 days Do not use a separate if/else branch for each month. Use Boolean operators. Sample Run Sample Run Sample Run Enter a month: 6 Enter a month: 3 30 days 31 days Enter a month: 2 28 or 29 days Marks: 2 n[ ]: Add tag # insert code Add tag . Exercise# 4: Write a program that prompts the user to provide a single character from the alphabet. Print Vowel or Consonant, depending on the user input. If the user input is not a letter (between a and z or A and 2), or is a string of length > 1, print an error message. Sample Run Sample Run Sample Run Sample Run Enter one character python That input didn't have a valid length Enter one character: B Enter one character, e Consonant Vowel Enter one character: & That was neither a vowel nor a consonant Marks: 2 In [ ]: Add tag # insert code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

3-18. An advertisement for peanut butter?

Answered: 1 week ago