Where can I write comments in my code?


#1

Is it ok to write comments after a variable ? Like this:

row_count = 13
# this variable counts how many rows of the spreadsheet we have.

FAQ: Learn Python - Python Syntax - Comments
FAQ: Learn Python - Python Syntax - Comments
#2

Hi @systemslayer81636,

You can put a comment anywhere in your code, except for at the beginning of a line of code. Examples 1-3 here will print out "hi" to the screen, but #4 is just a comment with some code in it, and won’t print anything:

1. # say "hi"
   print("hi")

2. print("hi") # say hi

3. print("hi")
   #say hi

4. # say hi print("hi")