Skip to content
Advertisement

Given a folder path in Colab, how can I extract a specific portion of that in python?

For an example, I have my folder path as “/content/data/a/b/c/d/” How can I extract the “b” from this path?

Advertisement

Answer

If “b” never moves

JavaScript

If it does move

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement