Question

For all questions inputs are given. User Input is not required. For all output: Print using...

For all questions inputs are given. User Input is not required.
For all output: Print using a print() statement

1. Answer the following questions by writing a separate code for each part but submit
as a single .py file:
Months = [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘June’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’].
a. Write code to show/illustrate 3 different list methods that can be used to remove
‘Dec’ from the list Months. (10 points)
b. Output a list that has elements at even indices of the list Months i.e. at 0,2,4 and so
on. (10 points)
c. Print/Output a list such that all the elements of Months are reversed i.e. Dec comes
first and Jan comes last. (10 points)
d. Print/Output a list that has all elements of Months in alphabetical order. (10 points)

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Months1 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
Months1.remove('Dec')
print(Months1)

Months2 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
Months2.pop(11)
print(Months2)

Months3 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
del Months3[11]
print(Months3)

Months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
for i in range(len(Months)):
if i%2==0:
print(Months[i],end=' ')

print()
  
Months.reverse()
print(Months)

Months.sort()
print(Months)

Add a comment
Know the answer?
Add Answer to:
For all questions inputs are given. User Input is not required. For all output: Print using...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • calculate the monthly time-weighted and money weighted returns for shareholders in the ADKSX with using excel....

    calculate the monthly time-weighted and money weighted returns for shareholders in the ADKSX with using excel. In a text box nearby, comment on whether investors’ trading decisions have created value. Month ADKSX Return (%) ADKSX Cash Flow ($) Nov-09 3.49 -$10,648,393 Dec-09 6.93 -$618,800 Jan-10 -2.05 $940,820 Feb-10 5.74 -$2,484,437 Mar-10 5.19 -$3,699,836 Apr-10 5.48 -$1,379,757 May-10 -4.68 $2,145,936 Jun-10 -6.31 -$2,953,884 Jul-10 5.9 -$4,160,472 Aug-10 -5.18 $1,096,304 Sep-10 8.61 -$5,571,657 Oct-10 4.5 -$669,464 Nov-10 2.77 -$3,145,367 Dec-10 9.16 -$6,162,018...

  • Complete the following program in C; Have the user input the current month and return the...

    Complete the following program in C; Have the user input the current month and return the previous month. E.g. input -> 3, returns 2 input -> 1, returns 12 #include <stdio.h> #include <stdlib.h> /* Write a function called previous_month that returns the previous month. start with the following code */ enum month {jan = 1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec}; typedef enum month month; int main() {             return0; }

  • Java code BIRTHDAY GRAPH5 4B Input Standard input Output Standard output Topic Array & Array Processing...

    Java code BIRTHDAY GRAPH5 4B Input Standard input Output Standard output Topic Array & Array Processing Birthday Graph Problem Description Everyone loves to be celebrated on their birthdays. Birthday celebration can encourage positive social E interaction among co-workers, foster friendship among classmates or even strengthen bond between E BOBO Birthday graph can be display in many forms. It can a creative drawing consists of cupcakes, balloons, UU candles with names, or it can be in the form of simple bar...

  • That is the question. There's no more information I can give you about it. The information...

    That is the question. There's no more information I can give you about it. The information technology department needs to forecast spending on cyber security. The data for several months is supplied below. Be careful since the data is listed beginning with the most recent. The forecasting method to be used here is exponential smoothing with trend accounting for seasonality given a smoothing constant (alpha) of 0.26, a trend smoothing constant (delta) of 0.59, a previous trend amount, seasonally adjusted,...

  • Code with Java using arrays and Scanner only ( input should end with 0 to terminate...

    Code with Java using arrays and Scanner only ( input should end with 0 to terminate the program) Everyone loves to be celebrated on their birthdays. Birthday celebration can encourage positive social interaction among co-workers, foster friendship among classmates or even strengthen bond between families. Birthday graph can be display in many forms. It can a creative drawing consists of cupcakes, balloons, candles with names, or it can be in the form of simple bar chart to indicate the birthday...

  • AmeriPlas, Inc., produces 20-ounce plastic drinking cups that are embossed with the names of prominent beers...

    AmeriPlas, Inc., produces 20-ounce plastic drinking cups that are embossed with the names of prominent beers and soft drinks. The sales data are: Date Sales Jan-13 40,358 Feb-13 45,002 Mar-13 63,165 Apr-13 57,479 May-13 52,308 Jun-13 60,062 Jul-13 51,694 Aug-13 54,469 Sep-13 48,284 Oct-13 45,239 Nov-13 40,665 Dec-13 47,968 Jan-14 37,255 Feb-14 38,521 Mar-14 55,110 Apr-14 51,389 May-14 58,068 Jun-14 64,028 Jul-14 52,873 Aug-14 62,584 Sep-14 53,373 Oct-14 52,060 Nov-14 51,727 Dec-14 51,455 Jan-15 47,906 Feb-15 53,570 Mar-15 69,189 Apr-15...

  • PLEASE HELP... NO ONE WILL ANSWER THIS QUESTION. home / study / business / finance / finance questions and answers / con...

    PLEASE HELP... NO ONE WILL ANSWER THIS QUESTION. home / study / business / finance / finance questions and answers / consider the monthly returns of ford motor company and general electric shown on the next page. ... Question: Consider the monthly returns of Ford Motor Company and General Electric shown on the next page. A... Consider the monthly returns of Ford Motor Company and General Electric shown on the next page. An Excel spreadsheet with the data is also...

  • Given the following data, what is the Mean Absolute Deviation (MAD): Month Demand Forecast Jan 100...

    Given the following data, what is the Mean Absolute Deviation (MAD): Month Demand Forecast Jan 100 110 Feb 100 100 Mar 120 100 Apr 110 90 May 100 110 Jun 90 100 Jul 80 90 Aug 90 80 Sep 100 110 Oct 110 100 Nov 110 110 Dec 120 110 A. 10 B. 20 C. 30 D. 133.33

  • question asking for moving average .. i used the data analysis tool in excel it gives...

    question asking for moving average .. i used the data analysis tool in excel it gives me the right answer but with wrong in sequence The normal Fourmal says = Sum of 3 months / 3 = F for the 4th month But in data analysis tool it comes in forecast of the 3rd month please let me know why it does not come in the right sequence and how to solve this issue 1 A-F^2 25.61 by using Normal...

  • help with all please. our: Labs 9, 11, andec 03, Wed, 8ay has dry.warm to hot summers and mild, somewhat 16. Which of the following mid-latitude climates has rainy winters? a. Tropical Savanna. b....

    help with all please. our: Labs 9, 11, andec 03, Wed, 8ay has dry.warm to hot summers and mild, somewhat 16. Which of the following mid-latitude climates has rainy winters? a. Tropical Savanna. b. Humid Continental c. Mediterranean. d. Tropical Monsoon. e. Subarctic (Boreal Forest 17. Within the Kö a lower-case 'w' indicates a. a steppe (semi-arid) climate; wet winter season lwilt e ate Clesilicalion ystom, anupper cone W idcale b. a tundra climate; warm winter season a cool-summer climate;...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT