Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16862

Indent and comments in function in Python [duplicate]

$
0
0

I am using Python 2.7 and wrote the following:

def arithmetic(A):    x=1"""Some comments here"""    if x=1:        x=1    elif x=2:        x=2    return 0

But it has the indentation issue:

    if x=1:    ^IndentationError: unexpected indent

So how to write comments in the function?


Viewing all articles
Browse latest Browse all 16862

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>