Why didn’t python just use the traditional style of comments like C/C++/Java uses:
/**
* Comment lines
* More comment lines
*/
// line comments
// line comments
//
Is there a specific reason for this or is it just arbitrary?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python doesn’t use triple quotation marks for comments. Comments use the hash (a.k.a. pound) character:
The triple quote thing is a doc string, and, unlike a comment, is actually available as a real string to the program:
It’s not strictly required to use triple quotes, as long as it’s a string. Using
"""is just a convention (and has the advantage of being multiline).