What Good are Functions? Lesson Intro, Quick question [SOLVED]


#1

I recall that when writing comments in python, we use # which returns a line of grey text.
Why is """ use in this case? What is the difference?

def tax(bill):
    """Adds 8% tax to a restaurant bill."""


#2

There are two styles of comments in python

# single line comment

" " " this is a multiline comment
which spawns many lines " " " - Comments in Python


#3

They aren't comments, but they can be used as such because python ignores values that are not used. Strings used that way at the beginning of a module, class, or function are an exception, they become docstring attributes to those objects


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.