[BUG] Unit-1 / Final Quiz - Don't change the value of page

I keep getting an error that says "Your submission was incorrect. Don't change the value of page."

I've not changed the value of page, and my code runs fine on a regular python interpreter.

# page = contents of a web page
page = '<div id="top_bin">    <div id="top_content" class="width960">       <div class="udacity float-left">            <a href="http://www.xkcd.com">'
start_link = page.find('<a href=')
start_url = page.find('"',start_link) + 1
end_url=page.find('"',start_url)
url = page[start_url:end_url]

how is that changing the value of page?

asked 21 Feb '12, 00:41

gubatron's gravatar image

gubatron
156148

accept rate: 100%

1

I've updated the quiz to use a page variable without spaces. So paste in everything after start_link= and it should work.

(22 Feb '12, 17:11)

PeterUdacity ♦♦

PeterUdacity's gravatar image

24 Answers:

123next »

Try your solution now. I've updated the grading code. Sorry for the trouble!

link

answered 21 Feb '12, 01:53

PeterUdacity's gravatar image

PeterUdacity ♦♦
36.3k73220334

start_url = page.find('"', start_link)
end_url = page.find('"', start_url + 1)
url = page[start_url + 1:end_url]

This yields "Good job" on the bottom alert but "Try again" on top. I say give it a couple days and try again after they have time for some ironing out.

j

link

answered 21 Feb '12, 01:03

Jake%20Solomon's gravatar image

Jake Solomon
4824921

1

That was a fault on my end. Fixed now!

(22 Feb '12, 17:12)

PeterUdacity ♦♦

PeterUdacity's gravatar image

one step method method

url= page[ start_link+9 : page.find('"',start_link+10)]

link

answered 21 Feb '12, 12:16

1linsanity's gravatar image

1linsanity
2.8k73041

This wont help next week when u need to fined all urls

(25 Feb '12, 18:55)

Glock0450

Glock0450's gravatar image

@Marek Kotewicz and @KarenT: While your code does produce the correct output, we wanted you to use the "find" command in this problem.

Also, some quizzes will expect you to print something and some will not. We realize that this is an easy thing to make a mistake with and we will try to always be as clear as possible (for example, the print command will usually be pre-populated in the code if we expect a print), but if you ever make a mistake you will be told so with an error message and you can easily make the necessary change.

link

answered 21 Feb '12, 18:20

AndyAtUdacity's gravatar image

AndyAtUdacity ♦♦
58.3k112263305

i tried and got the result ..it works ..

link

answered 22 Feb '12, 05:00

priya's gravatar image

priya
3062515

I have experienced the same issue, hope they find a solution for this quickly

link

answered 21 Feb '12, 01:46

aonechris's gravatar image

aonechris
1

I can confirm that this quiz is working correctly. jsolomon, I tried your code and it worked for me, so they possibly have fixed it since you tried it last.

link

answered 21 Feb '12, 02:05

Eric%20Solomon's gravatar image

Eric Solomon
2.4k71325

Hello Peter

When I write code, it shows the correct output but when I submit, it wont accept
The error says : "Your submission was incorrect. You shouldn't print anything for the submission in this quiz."

link

answered 21 Feb '12, 05:34

Dinesh%20M-2's gravatar image

Dinesh M-2
1.7k1226

ilikeudacity, you don't print anything in this quiz. I'm guessing you did what a lot of others, myself included, did at first as well and printed the url at the end. Remove your print statement and submit. =D

link

answered 21 Feb '12, 07:46

Jacob%20C.%20Ting's gravatar image

Jacob C. Ting
33518

It is working now.

link

answered 21 Feb '12, 09:52

Dinesh%20M-2's gravatar image

Dinesh M-2
1.7k1226

Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags

×30,784
×3,829
×738
×211

Asked: 21 Feb '12, 00:41

Seen: 2,531 times

Last updated: 08 Apr '12, 04:37