You don't need sudo to set up Python (and probably most commonly used languages). But beside that, I don't think rm and sudo are the third and fourth thing you should be typing into a terminal, whatever your end-goal.
If you haven't seen it before, an ancient but worth-thieving-from example of a beginner programming manual is 'The Applesoft Tutorial'.
When setting up Python (and really most languages), you end up needing things like sudo.
Really it was one of the missing pieces of content that beginners needed to get into Tracy's other books like https://hellowebbooks.com/learn-django/.