Strings And Console OutPut


#1

Under ‘Strings And Console Output’ - ‘Strings’ section,

The instructions were — Create a new variable brian and assign it the string “Hello life!”.

This is my code :

Set the variable brian on line 3!
name = "Ryan"
brian = “Hello life”

When I ran it, nothing happened. No output at all, when I clicked the ‘run’ button , the ‘run’ icon disappears and there is a display of a run circling around it for a few seconds, then it reverts back to normal ‘run’ icon , and nothing happens. Nothing is displayed. Can anyone explain why ?


#2

defining variables doesn’t produce any output, you can print the variable values if you want

Its often the case, that huge parts of code written given no output


#3

Oh ya, I keep forgetting that Python requires a ‘print’ statement to print stuff out

When I add 2 prints to the text, I get a result printed. Keep forgetting haha

Set the variable brian on line 3!

name = "Ryan"
brian = "Hello life"
print name
print brian

Result :
Ryan
Hello life


#4

so, issue resolved i assume?


#5

Yes ! I kept forgetting the print statements …


#6

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