Reposition specific words within a Python array

Asked 2 years ago, Updated 2 years ago, 43 views

It's Python version 3.

I want to change the position when I repeat the arrangement and see a specific word.

Array example: ["I'm", "I'm a fool", "Because", "I don't know"] ["I'm a fool", "You", "I don't know"] In case of "foolish" in , I would like to move to the second seat and make a new arrangement and return it.

The "fool" position may be at the front, or it may be caught in the middle. How can I handle it, including all the cases?

python array

2022-09-22 14:53

0 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.