Question
1. Please write a Python 3 Program and show all outputs. Write some functions that: return a sequence with the first and last items exchanged.
1. Please write a Python 3 Program and show all outputs.
Write some functions that:
return a sequence with the first and last items exchanged.
return a sequence with every other item removed
return a sequence with the first and last 4 items removed, and every other item in between
return a sequence reversed (just with slicing)
return a sequence with the middle third, then last third, then the first third in the new order
NOTE: these should work with ANY sequence but you can use strings to test, if you like.
1. Please write a Python 3 Program and show all output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started