Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 23 Online
OpenStudy (anonymous):

I am a beginner in programming and now learning Python by myself. I couldn't do this example: def newLine(): print print "first line" newLine() print "second line" and the output is: first line second line How do you type the "print" part in paragraphs? There are no tutorials on that matter.

OpenStudy (anonymous):

http://www.openbookproject.net/thinkcs/python/english2e/ch03.html the"print 'first line', newLine... " part. How do you write in paragraphs?

OpenStudy (anonymous):

Well the statements defining the program newLine look fine to me. The second part -- the statements running the program -- don't need to be indented, as they are all separate statements which are not part of a program definition.

OpenStudy (anonymous):

I could explain and help more if you can tell me exactly the output you want. Anyway, try this: print "first line" print "\n" print "\tthis is line tabbed by one tabspace" Output: first line this is line tabbed by one tabspace

OpenStudy (anonymous):

I'm not exactly sure what you're asking, but if you use triple quotes, you can type on multiple lines. print """Hi there. This is another line. This is yet another line."""

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!