Multi-line comments issue


#1

Hi, I need someone to explain to me why reveals "None" when i submit my multi-comments under the instructions.

My code as shown as following: (i was actually quoted some lyrics from Marilyn Manson)

“”“Sweet dreams are made of this"""
"""Who am i to disagree"""

When i clicked "save and submit" button, the interpreter shows "None".

I just still confuse why reveals "None", personally think the result will show the comments that i wrote. Can anyone help me to explain this issue. Really appreciate.


#2

Click here:
What is None data Type

Every function in python return something .
If a function don't have anything to return ,by default it returns None.
Try this example running on Python IDLE..

x = print 4
print x

One another way to think about None..
As None is a data type, You can store it any variable.
y = None
what does it means then?
It means that the value of data is set to Empty
do tell me what you got! :slight_smile:


#3

Hello,

Just an idea:

Be careful at the set of triple quotation marks " " " something " " ". These signs are used for a multi-line comment in editor.

https://www.codecademy.com/courses/introduction-to-python-6WeG3/2/1?curriculum_id=4f89dab3d788890003000096

A comment is a line of text that Python won't try to run as code. It's just for humans to read.
please see :

https://www.codecademy.com/courses/introduction-to-python-6WeG3/2/2?curriculum_id=4f89dab3d788890003000096#

Your lyrics must be defined as a string if you want to print it on the interpreter.

lyrics="Sweet dreams are made of this
Who am i to disagree"
print lyrics

I hope it was useful my explanation.


#4

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