Practice section in Python


#1

Why does it say incorrect syntax value for my code?
# Assign your variables below, each on its own line! 
caesar = "Graham"
praline = "John"
viking = "Teresa"
# Put your variables above this line

print caesar="Graham"
print praline="John"
print viking="Teresa"

#2

You only have that put:
print caesar
not:
print caesar="Graham"
because the variables are for save values


#3

You can't use equal to- sign in python output statements.
As you see, you defined the variables, so they have their values. In this case the values are these strings:

 caesar = "Graham"
 praline = "John"
 viking = "Teresa"

Now you just print them out.

 print caesar
 print praline
 print viking

And the output will be

 Graham
 John
 Teresa

Hope this helps. :slight_smile:


#4

so I use no equal signs?


#5

Yes, you don't need them at all when you print stuff out. :wink:


#6

wow both of you thanks!!!


#7

No problemo. Can you press 'solution' at the post that solves the problem?


#8

Havent I already done it I?


#9

Well I see. Thank you, hope you understood the idea! :wink:


#10

I did thank you :grinning:


#11

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.