Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.

string Error

+2 votes
here is the exercise
Examine and try out the following code:
str="Hello World"; print str;

here is my answer
str="Hello World"
print str ========> Error
print(str)========>Error
print("str")=======>Error
print "str"========>Error

Why????????????????
and what you suspect me to print???
posted 12 years ago in Python by elrachyd (1,500 points)

2 Answers

0 votes
Hi,

We have singleline and multiline exercises.
It looks like you tried a singleline exercise using multilines.
Please retry the code using just a single line like below:

>>> str="Hello World"; print str;
Hello World
answered 12 years ago by codeadmin (113,880 points)
0 votes
hello world..
which python version do you use?
if python 3.2 =

str="Hello World"; str  ;
answered 12 years ago by masonjr (910 points)

Related questions

+1 vote
0 answers
posted 6 years ago in Python by (1,740 points)
+4 votes
1 answer
posted 12 years ago in Python by Manuel Pacheco (1,280 points)
+7 votes
1 answer
–1 vote
1 answer
posted 12 years ago in SQL by SUNRISER (2,050 points)