Академический Документы
Профессиональный Документы
Культура Документы
But please be considered if you are using Unix system & if you make the program executable with chmod & have the line as this starting with # but including !.
#! /usr/bin/env python3
Multi line Commenting Texts are enclosed with triple-double quote symbols can be used as multi line comments. Example code:
this is a multiline comment which spawns many lines
Also this multi line comments can be used to embed doc strings in a function. To explain this scenario let me define a class human with some functions. Example code:
class human: this class can be used to define a type of human. It also has following methods and properties Basic_info() Favourites() def Basic_info(name,age,sex): myname=name; myage=age; mysex=sex; def Favourites(activity): print My Favourite activities are ,activity
In above piece of code the triple quoted string not only is a comment but when declaring an object say h=human and then h. __doc__ returns those comments & also help(human) returns same comments.