15. String Formatting with %, Part 2


#1

https://www.codecademy.com/courses/python-beginner-sRXwR/3/4?curriculum_id=4f89dab3d788890003000096


When I submit the code, it starts to compile and execute and then it just gets stuck and it the submit button is stuck on the spinning wheel.
I get a "What is your name?" but nothing else. It wont give me an error or completed. It is just stuck!

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)

`


#2

Code is correct. Try to refresh the page.


#3

I have, many times and every time I submit it just keeps running it, without completion. I've ended up just skipping the exercise now.


#4

Are you stuck with a spinning gear and it feels like your code is frozen? That's because the code is asking you three questions! Click inside the console window, type in your name, and then press Enter (or Return).


#5

Oh wow!!!! Ok, see the instructions weren't there for that. A huge lapse in understanding.


#6

you could click on Stuck? Get a hint! :slight_smile:


#7

Can someone help me with what exactly it is I'm doing wrong? I know I may not be the smartest guy around, but I can't figure out what I'm doing incorrectly.


#8

you have to use %s to instead of the value.

like

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

when you ask user you cant say what will be answer.same here .if you yourself print the result so what is the benefit of asking the question ?you have to print the user's answer not your.

make sense :slight_smile:

i hope you've undersatnd.




Always create a new topic.dont post on other's topic.


#9

What part of the code innitlized this que?


#10

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