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 1 year 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 1 year ago by codeadmin (110,730 points)
0 votes
hello world..
which python version do you use?
if python 3.2 =

str="Hello World"; str  ;
answered 1 year ago by masonjr (910 points)

Related questions

+4 votes
1 answer
posted 1 year ago in Python by Manuel Pacheco (1,280 points)
+6 votes
1 answer
0 votes
1 answer
posted 10 months ago in SQL by SUNRISER (1,960 points)
+2 votes
1 answer
posted 8 months ago in Python by dr.emad.adnan (560 points)