# HW 4.5 and 4.6 Incorrecct?

 1 I don't understand why these are incorrect. Could someone please point out my errors? @PeterUdacity In case my answers turn out to be correct, and since I've seen you ask others the same question: I did not use an external editor. 4.5 Better Splitting: def split_string(source,splitlist): list = [] start = 0 for i in range(len(source)): if source[i] in splitlist: if start < i: list.append(source[start:i]) start = i + 1 else: if i == len(source) - 1: list.append(source[start:]) return list  4.6 Improving the Index def add_to_index(index, keyword, url): for entry in index: if entry[0] == keyword: if url in entry[1]: return entry[1].append(url) return index.append([keyword, [url]])  asked 21 Mar '12, 21:35 pseudonoob 200●3●12 accept rate: 40%

 0 Have you tried to resubmit your code? There is sometimes an error message telling you what was wrong. Your split string code doesn't return anything. answered 21 Mar '12, 21:41 fnenu-1 ♦♦ 18.5k●19●81●231 I missed the return statement in the copy-paste to the forums. I've fixed it. How do I resubmit my code? I thought the grading was only done once. (21 Mar '12, 21:55) pseudonoob The grading is only done once, but after the deadline it's just like a quiz so you can submit it again and get some sort of message about why it was marked wrong. It won't change the homework grade though. (22 Mar '12, 23:01) fnenu-1 ♦♦
Question text:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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

×15,880
×1,718
×87
×41
×15
×12