First Python Program!

Lets start with writing the program, all the beginners write :


Oh.. Isn't it like really great! Your first python program. In IDLE!!!

So how does this work???
Just type anything you want to, in single quotes (' ') and all that will be printed.
No what if you want to print 'Hey isn't this a wonderful day?'


OOPS... Syntax Error.
Reason?? Python finds for the next '. So it thinks that the string is 'Hey isn' and since it is not able to decode what the next part of the string ie. t this a wonderful day?' is., so it throws the ERROR. (Observe the color of the content written inside print() )

How to fix it??
Many ways. Lets look at some :



The use of double quotes (" ") and escape character ( \ in this case) did the trick!

:)



Comments

Popular posts from this blog

Writing your own ejabberd Module

npm ECONNREFUSED error

Conditional Flow - Spring Batch Part 6