Question: im programming in python 3. i have a question about lists. say i have a list of 5 items. how can i swap the position

im programming in python 3. i have a question about lists. say i have a list of 5 items. how can i swap the position of 2 items? for example: a list called mypets

cat

bird

fish

dog

insect

say i wanted to swap the positions of fish and insect, or cat and bird, or fish and cat, etc?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!