What are the two types of comments in Python? How are they written?

Answer:

Answer by student

The two types of comments in Python are single-line comments and multi-line comments. Single-line comments are written by using a # symbol at the beginning of the comment . Multi-line comments are written by using triple quotes (‘’’ or “”") at the start and end of the comment.

Detailed answer by teachoo

The rest of the post is locked. Join Teachoo Black to see the full post.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo