Printing Variables


I have a right code as advised but still throwing an error

Print "Ping!"

"""Assign the string "Ping!" to
the variable the_machine_goes on
line 5, then print it out on line 6!"""

the_machine_goes = "Ping!"
Print = "the_machine_goes"


When you want to print a variable you do not place it in quotations. Putting it in quotations changes it in to string on its own.


You don't use quotations when printing a variable


Consider this and apply your understanding to help clear your exercise.

greeting = “Hello, World!”
print greeting


hi i am getting the console output also i have set the variable the_machine_goes ="ping!" still been asked, whether i had set it to ping or not i don,t know what am i doing wrong anyone can help me please!


Maybe it's because you did not lowercase the word print (you wrote Print instead of print)


when printing, don't use quotes for the string you want to print. Instead, leave the quotes and just add a space between print and your string... like this =>

the_machine_goes = "Ping!"
print Ping!


thanks for taking ur time out and replying but its still not working i am stuck.


thanks for ur reply nope i am using lower case p don,t know i am stuck cant move further


If you have followed the tips here you should be passing the section. Copy and paste this exactly how it is:

the_machine_goes = "Ping!"
print the_machine_goes


thank you soo much it worked


thank u very much


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