Make a calendar for a given year (12 months calendar) from this code: # use list or
Fantastic news! We've Found the answer you've been seeking!
Question:
Make a calendar for a given year (12 months calendar) from this code:
Transcribed Image Text:
# use list or tuple for the given data month_name = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', nly_month_day = 7: 'July', 8: 'August', 9: 'September', 10:'October', 11: 'November', 12: 'December'} [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] ly_month_day = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # Given 2000 Jan. 1 falls on a Sat. offset_0 = 6 # Code here yyyy = int(input("Please Enter the year you would like to print(yyyy): ")) mm = int (input("Please Enter the month you would like to print(mm): ")) # To calculate odd days day =(yyyy - 1) % 400 day = (day//100) * 5 + ((day % 100) - (day % 100)//4) + ((day % 100)//4) * 2 day day % 7 = d = 0 if yyyy % 4 == 0: else: for i in range(mm - 1): d+= ly_month_day[i] for i in range(mm-1): d+= nly_month_day[i] day += d % 7 day day % 7 S="I print(s.rjust (6, '), month_name [mm], yyyy) print( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') if mm == 4 or mm == 6 or mm == 9 or mm == 11: for i in range(31 + day): if i # use list or tuple for the given data month_name = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', nly_month_day = 7: 'July', 8: 'August', 9: 'September', 10:'October', 11: 'November', 12: 'December'} [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] ly_month_day = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # Given 2000 Jan. 1 falls on a Sat. offset_0 = 6 # Code here yyyy = int(input("Please Enter the year you would like to print(yyyy): ")) mm = int (input("Please Enter the month you would like to print(mm): ")) # To calculate odd days day =(yyyy - 1) % 400 day = (day//100) * 5 + ((day % 100) - (day % 100)//4) + ((day % 100)//4) * 2 day day % 7 = d = 0 if yyyy % 4 == 0: else: for i in range(mm - 1): d+= ly_month_day[i] for i in range(mm-1): d+= nly_month_day[i] day += d % 7 day day % 7 S="I print(s.rjust (6, '), month_name [mm], yyyy) print( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') if mm == 4 or mm == 6 or mm == 9 or mm == 11: for i in range(31 + day): if i
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
2. (20 points) Wolfe conditions. Consider the following function f(x)=500-x(x-20) (a) Is the function f(x) concave? (One way to think about it is that if -f(r) is convex, then f(x) is concave). (b)...
-
The president of Hill Enterprises, Terri Hill, projects the firm's aggregate demand requirements over the next 8 months as follows: January February March April 1,400 1,600 1,700 1,800 May June July...
-
Based on your reading of the rules of Professional Code of Conduct as given by AICPA, which part of the code did the accountants of Enron, Waste Management or Wells Fargo have violated and how about...
-
Rita is a self-employed taxpayer who turns 39 years old at the end of the year (2014). During 2014, her net Schedule C income was $300,000. This was her only source of income. This year, Rita is...
-
The pretax financial income of Truttman AG differs from its taxable income throughout each of 4 years as follows. Pretax financial income for each year includes a non-deductible expense of...
-
Compare and contrast between various valuation methods. Which valuation methods are most appropriate for manufacturing firms and which are the most appropriate for internet-based ventures?
-
Jim Sellers has been able to estimate his utility for a number of different values. He would like to use these utility values in making the decision in Problem 3-42: U ( $80,000) = 0, U ( $65,000) =...
-
You are the CFO at ABC Inc., a public company listed in Toronto Stock Exchange (TSX). Its basic business is high-temperature treatment services for contaminated soil. It is now December 9 th , 2022,...
-
Assume a 5-bit, 2's complement scheme to represent signed integers. a) (3 pt) Show the range of integers that can be represented. b) (12 pt) Do the following arithmetic operations and detect...
-
The following information is available for Pyle Garage for March, Year 2 : BANK STATEMENT HAZARD STATE BANK 2 1 5 MAIN STREET HAZARD, GA 3 0 3 2 1 Pyle Garage 6 2 9 Main Street HAZARD, GA 3 0 3 2 1...
-
During the month of June, Ace Incorporated purchased goods from two suppliers. The sequence of events was as follows: June 3 Purchased goods for $ 4 , 2 0 0 from Diamond Incorporated with terms 3 / 1...
-
Shown here are annual financial data for a merchandising company and a manufacturing company. Music World Retail Wave - Board Manufacturing Beginning inventory Merchandise $ 1 3 5 , 0 0 0 Finished...
-
Keith Williams and Brian Adams were students when they formed a partnership several years ago for a part - time business called Music Works. Adjusted trial balance information for the year ended...
-
" I ' m not sure we should lay out $ 3 2 0 , 0 0 0 for that automated welding machine," said Jim Alder, president of the Superior Equipment Company. " It would cost us $ 8 8 , 0 0 0 for software and...
-
Find the quantity q that maximizes profit if the total revenue, R(q) , and total cost, C(q) are given in dollars by R(q) = 5q - 0.002q 2 and C(q) = 200 + 2. 2q , where 0 q 2500 units
-
Smiths Family Fashions implemented a balanced scorecard performance measurement system several years ago. Smiths is a locally owned clothing retailer with fashions for men, women, teens, and...
-
In 2012, Michael has net short-term capital losses of $2,000, a net long-term capital loss of $45,000, and other ordinary taxable income of $45,000. a. Calculate the amount of Michael's deduction for...
-
Walter, a single taxpayer, purchased a limited partnership interest in a tax shelter in 1985. He also acquired a rental house in 2012, which he actively manages. During 2012, Walter's share of the...
-
In June of 2012, Maureen's house is vandalized during a long-term power failure after a hurricane hit the city. The president of the United States declares Maureen's city a disaster area as a result...
-
Who is the audit client? Why is it important that the auditor understand who the true audit client is and why that party is the audit client?
-
Explain how "privileged communication" differs from confidential information.
-
Which of the following statements best explains why the CPA profession has found it essential to promulgate ethical standards and to establish means for en- suring their observance? a. Vigorous...
Study smarter with the SolutionInn App