anonymous
  • anonymous
Just a thought on the print statement, where we have String = hello world, it can be printed with or without brackets, like print String OR print(String) Is there a recommended or preferred way of doing this ?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
You will need quotes for one. Then I think that it depends on the version of Python if the brackets are required or not!
MicroBot
  • MicroBot
ye i agree with Chris
anonymous
  • anonymous
No,only quotes used on assigning the value, on printing out see below both ways >>> String = 'hello world' >>> print String hello world >>> print(String) hello world

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

MicroBot
  • MicroBot
what chris says is that some older versions might not work without brackets or find brackets wrong. what python version do u use? tbh if i could use both id choose the brackets cause seems more clean that way.
anonymous
  • anonymous
That's what I thought, seems better with the brackets
anonymous
  • anonymous
Python 3 requires print (), while Python 2.x is fine with either. I generally see it not using parentheses if it's Python 2.x.
anonymous
  • anonymous
kTwitch is right and since I use 3.x for a different course I prefer to use the brackets rather than switching back and forth.

Looking for something else?

Not the answer you are looking for? Search for more explanations.