Why does nothing happen when I press Run?

Question

Why does nothing happen when I press Run?

Answer

If you see “What is your name?” printed to the terminal window on the right, then it’s just waiting for you to type your name, press enter, and then answer the next two questions in the same way. When it’s done taking input from you, it will display the string you’ve built and pass the exercise.
If you just see a black screen when you press Run, be sure that you’ve used string formatting correctly and if that doesn’t work, try these few steps:
Be sure to use Chrome, it’s typically the most reliable,
Clear your browser’s cache and press Cmd + Shift + R (Mac) or Ctrl + F5 (Windows),
Or check out our official troubleshooting guide

2 posts were split to a new topic: What do These Backslashes Do?

I would like to comment that this exercise is not working for me. I still do not understand it even after clicking to reveal the solution. I would very much appreciate a step by step from someone who did complete this exercise. I’m pretty sure I’m just overthinking it, but I can’t seem to get it right.

1 Like

so this is my code
name = raw_input(“What is your name?”)
quest = raw_input(“What is your quest?”)
color = raw_input(“What is your favorite color?”)

print "Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.” % (name, quest, color)

This is also the code if you press solution, but It wont let me type in my quest it goes What is your name? and you answer your name, then it asks What is your quest?What is your favorite color? and I don’t understand why help would be amazing.

1 Like

@chiprunner92338
To my understanding, when you put %s into the code, you are telling Python to substitute a string data type right there. Think of %s and substitute string. If you use %d you are telling Python that you want to substitute an integer decimal value. The % also converts data types, such as from decimal to string.
If you want to learn more, you can look at the link below. Yes, it talks about data types at first, but about half way down it talks about the substitutions.

https://docs.python.org/3/library/stdtypes.html#string-formatting-operations

I am sorry if I have confused you at all or if I am mistaken.

thanks ill see if it helps. If you enter the code youll notice it doesn’t work properly for some reason.

1 Like

The most simple and working solution with this issue I was able to find was to divide default code lines with empty line by presssing Enter. So, it must be like this:

1 name = raw_input("What is your name?")
2
3 quest = raw_input("What is your quest?")
4
5 color = raw_input("What is your favorite color?")

And if my following code is right - it works fine. Even after pressing reset button - works fine without changing the first three lines.
Don’t know why it worked, though.

2 Likes

name = raw_input(“What is your name?”)
quest = raw_input(“What is your quest?”)
color = raw_input(“What is your favorite color?”)

print "Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.” % (name, quest, color)

*Leave your code like this
**Hit Run
*** click on box on right
****Type your name Type your quest type your color

1 Like

what is the backslash used for in the code between the two strings?

print "Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.” % (name, quest, color)

1 Like

Hey, this is late but the solution i found was to split the line for “your name is %s” and “your quest is %s” like below. For me, this solved the problem of the quest and colour questions appearing together.

name = raw_input(“What is your name?”)
quest = raw_input(“What is your quest?”)
color = raw_input(“What is your favorite color?”)

print "Ah, so your name is %s, "
“your quest is %s,”
“and your favorite color is %s.” % (name, quest, color)

Hi, yes the platform maybe has an error. I do the things well but…

3 Likes

I’m getting the same error message…not cool.

@victoriocanavesi & @dmf1990. Everyone is getting these errors as well. I recommend sending in a bug report.

1 Like

Personally I think it’s a bug with the raw_input. If you remove those sections and just force in strings, it will at least let you past. My code appears like this:

name = “Chris”
quest = “To find The Holy Grail”
color = “purple”

print "Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.” % (name, quest, color)

Thankfully the program doesn’t check to see if any of the upper section is correct, so it gives you the Next button once the output looks right.

5 Likes

Very true, but the point of the exercise is that you practice raw input. So bypassing it like that defeats the purpose. I guess if you have already solved the exercise then maybe but otherwise…

this is the same error am getting too

Hi @emmanuelenwuka012199, Welcome to the forums!

What lesson are you getting this error on?

[My problem solved this way] Hey i got same problem when i click on run and when i write in output box it didn’t print anything but then again i did that and this time i select output box with a click and write into box and i got that.

1 Like

@stevencopeland
The error is happening here:
Learn Python 2 | String Formatting with %, Part 2
https://www.codecademy.com/courses/learn-python/lessons/strings--console-output/exercises/string-formatting-with--part--1?action=resume_content_item

What is your name? Meg
Traceback (most recent call last):
File “python”, line 1, in
ExecTimeoutException: Program took too long to terminate.

Mine won’t even ask for my quest, it thinks for a while after I hit Enter after typing my name, then pops up with the error before showing anything else.

2 Likes