Yes.
Using # to start a comment is an agreement followed by all the major interpreted languages ββdesigned to work with POSIX systems (i.e. not Windows).
It also agrees well with the sequence "#!" at the beginning of the file, the OS recognizes βrun the command on this lineβ when trying to run the script file itself.
But basically it is a generally accepted convention. If python did not use # to start a comment, this is confusing for a lot of people.
EDIT
Using "#" as a comment marker seems to precede "#!" hash designation . "#!" was introduced by Dennis Ritchie between Unix 7 and 8, and languages ββthat support # as a comment marker existed before. For example, the Bourne shell was already installed by default when version 7 of Unix was introduced.
Consequently, the agreement to use "#" as a comment marker probably affected the choice of "#!" as a command line marker, not the other way around.
source share