'Python command not found, but found after restarting command prompt

I was working on a python project where I was about to run it, but then the command prompt responded with: "'python' is not a known bash or shell command."

I tried closing and opening the command prompt, but this time it worked. I don't really have a problem with it, but just wanted to know why this happened.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source