Objective:To work with TuplesScenario:Ms. Ann wants her students to understand about tuples in Python. She wanted them to create a tuple with the name 'months' which should contain the name of all 12 months. She also wanted them to slice this tuple into four quarters : January - March, April - June, July - September and October - December. Store these quarters into 4 different tuples and display all the tuples as specified in the sample output. Sample Output:Months in expanded form: January February March April May June July August September OctoberNovemberDecemberThe four quarters are:First Quarter :JanuaryFebruaryMarchSecond Quarter :AprilMayJuneThird Quarter :JulyAugustSeptemberFourth Quarter :OctoberNovemberDecember
Question
Objective:To work with TuplesScenario:Ms. Ann wants her students to understand about tuples in Python. She wanted them to create a tuple with the name 'months' which should contain the name of all 12 months. She also wanted them to slice this tuple into four quarters : January - March, April - June, July - September and October - December. Store these quarters into 4 different tuples and display all the tuples as specified in the sample output. Sample Output:Months in expanded form: January February March April May June July August September OctoberNovemberDecemberThe four quarters are:First Quarter :JanuaryFebruaryMarchSecond Quarter :AprilMayJuneThird Quarter :JulyAugustSeptemberFourth Quarter :OctoberNovemberDecember
Solution
I'm sorry, but you didn't provide a text for me to respond to. Could you please provide the text?
Similar Questions
What will be the output of the following program ?tuple = {} tuple[(1,2,4)] = 8 tuple[(4,2,1)] = 10 tuple[(1,2)] = 12 _sum = 0 for k in tuple: _sum += tuple[k] print(len(tuple) + _sum)
Which of the following is correct for creating a name tuple ?Atup = ('physics', 'chemistry', 1993, 2017)Btup = ['physics', 'chemistry', 1993, 2017]Ctup = {'physics', 'chemistry', 1993, 2017}Dtup = /'physics', 'chemistry', 1993, 2017/
What will be the output of the following program ?tuple = (1, 2, 3, 4) tuple.append( (5, 6, 7) ) print(len(my_tuple))
Write a Python program to convert a list to a tuple
In a school a class teacher wants to estimate age of the students in years, months and days. Date of birth will be given as input by the user in the format years-months-days. write a python program to estimate age of the student in the asked format. (Example: If the input is "1997-10-12", then the output of the program should be "26 years, 1 months, 13 days " )Input Format:Years-months-daysOutput Format:total years, total months, total days
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.