What's wrong with my code?
-
I'm teaching myself to program in Python and don't understand why this code is failing my tests. Can anyone tell me what is wrong? """ >>> nlist[2][1] 0 >>> nlist[0][2] 17 >>> nlist[1][1] 4 """ nlist = [[0, 1, 17],[1, 4], [0, 0]] if __name__ == '__main__': import doctest doctest.testmod() I'm getting the following message which doesn't make much sense to me **************************************… Failed example: nlist[1][1] Expected: 4 Got: 4
-
Answer:
seems you have whitespaces after the '4' in your doctest which causes the comparison to fail.
Chanz Chanz at Yahoo! Answers Visit the source
Related Q & A:
- What's wrong with this PHP Twitter API POST?Best solution by Stack Overflow
- What's wrong with my yahoo 360 page stat counter?Best solution by answers.yahoo.com
- What's wrong with msn hotmail?Best solution by Yahoo! Answers
- What's wrong with my digital camera?Best solution by Yahoo! Answers
- What's wrong with Nokia N97 Mini's wifi?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.