Python


#1

Can you help me figure this code.
Go ahead and print the_machine_goes in line 6.
print "the_machine_goes"
it is telling me to - Did you remember to print out “Ping!”?
print “the_machine_goes” “Ping!”?
after I tried this, my code is still off. What have I done wrong?


#2

you print the string "the_machine_goes", you should print the variable the_machine_goes, given the variable contains a value of ping!, this will be printed to the console


#3

ok like this
the_machine_goes ping!


#4

ok, i tried it and it did not work. What did I do wrong?


#5

I know it is something simple. What am I doing wrong?
Here is all of the instructions
Declare a variable called the_machine_goes and assign it the string value “Ping!” on line 5.

Go ahead and print the_machine_goes in line 6.
I have line 5 as correct, but not line 6, and it gives me this statement.
Did you remember to print out “Ping!”?


#6

the correct code is even given in the instructions (print the_machine_goes), this will print the value of the variable, doing print variable_name will print the value of the variable


#7

I still cannot get it right as this is what I typed in below for line 5 and 6
the_machine_goes = "Ping!"
print "the_machine_goes"
on the screen it does print out the machine goes, but the issue I am having is it tell me -
Did you remember to print out “Ping!”?
I don’t understand ping
I am new to coding and I don’t understand what I need to type to move on


#8

ok, I got it. thanks for the help.


#9

i gave you the correct code:

print the_machine_goes

and you can’t figure it out? :frowning:

here:

print "the_machine_goes"

you clearly print a string (strings are enclosed in quotation marks ("), not the variable

to print the variable, don’t include the quotation marks

we can print a string, which has the same name as a variable