Months of the Year
Python
15 pts
Months of the Year
A tuple months with all twelve months is given. Create three variables:
first_month— the first item (use an index)last_month— the last item (use a negative index)summer— a slice with June, July and August
Print the three variables in that order.
Expected output:
January
December
('June', 'July', 'August')
Checklist
- Keep
monthsunchanged and createfirst_month, the first item, using an index. - Create
last_month, the last item, using a negative index. - Create
summer, a slice with June, July and August. - Print the three variables in that order.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
