Question

In: Computer Science

in Python, make logic for birth colors for the months using arrays. Have recipient enter month...

in Python, make logic for birth colors for the months using arrays. Have recipient enter month and out comes the color

Solutions

Expert Solution

# Storing color names corresponding to each month of the year
birthColor =    {
  "January": "White",
  "February": "Pink",
  "March": "Yellow",
  "April": "Orange",
  "May": "Red",
  "June": "Brown",
  "July": "Blue",
  "August": "Green",
  "September": "Cyan",
  "October": "Purple",
  "November": "Violet",
  "December": "Black"
}

# Taking user input and storing in month variable
month = input("Enter your birth month: ") 

# Displaying birth color according to the month entered
print(birthColor[month]) 


Related Solutions

Write a Python program using functions and mainline logic which prompts the user to enter a...
Write a Python program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a file. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The average number in the list At a minimum, the numbers should...
Write a program named CheckMonth2 that prompts a user to enter a birth month and day....
Write a program named CheckMonth2 that prompts a user to enter a birth month and day. Display an error message that says Invalid date if the month is invalid (not 1 through 12) or the day is invalid for the month (for example, not between 1 and 31 for January or between 1 and 29 for February). If the month and day are valid, display them with a message. For example, if the month entered is 2, and the day...
Write a C++ program using dynamic arrays that allows the user to enter the last names...
Write a C++ program using dynamic arrays that allows the user to enter the last names of the candidates in a local election and the number of votes received by each candidate. The program must ask the user for the number of candidates and then create the appropriate arrays to hold the data. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should...
Assume that a bond will make payments every six months as shown on the following timeline (using six-month periods)
Assume that a bond will make payments every six months as shown on the following timeline (using six-month periods):The timeline starts at Period 0 and ends at Period 50. The timeline shows a cash flow of $ 20.92 each from Period 1 to Period 49. In Period 50, the cash flow is $ 20.92 plus $ 1,000.Period0124950Cash Flows$20.92$20.92$20.92$20.92+$1,000a. What is the maturity of the bond (in years)?b. What is the coupon rate (as a percentage)?c. What is the face value?
Do it in python please Write a program using functions and mainline logic which prompts the...
Do it in python please Write a program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a list. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The average number in the list At a...
Write a program in PYTHON, using a while loop, that asks the user to enter the...
Write a program in PYTHON, using a while loop, that asks the user to enter the amount that they have budgeted for the month. The program should then prompt the user to enter their expenses for the month. The program should keep a running total. Once the user has finished entering their expenses the program should then display if the user is over or under budget. The output should display the monthly budget, the total expenses and whether the user...
Make a menu for a restaurant using python. Make sure there are choices on the menu....
Make a menu for a restaurant using python. Make sure there are choices on the menu. Give me a little description of how you did it.
Write a Python program with correct indentation using functions and mainline logic which prompts the user...
Write a Python program with correct indentation using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a list. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The average number in the list At a minimum,...
Write a program In python of Jupiter notebook (using loops) that prompts the user to enter...
Write a program In python of Jupiter notebook (using loops) that prompts the user to enter his/her favorite English saying, then counts the number of vowels in that (note that the user may type the saying using any combination of upper or lower case letters). Example: Enter your favorite English saying: Actions speak LOUDER than words. Number of wovels: 10
Using python, allows a user to enter the values of two, 3x3 matrices and then select...
Using python, allows a user to enter the values of two, 3x3 matrices and then select from options including, addition, subtraction, matrix multiplication, and element by element multiplication. You should use numpy.matmul()for matrix multiplication(e.g. np.matmul(a, b)).The program should computer the appropriate results and return the results, the transpose of the results, the mean of the rows for the results, and the mean of the columns for the results.When entering data you should check that each value is numeric for the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT