Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74394 > unrolled thread

Re: codingbat question broken?

Started byChris Angelico <rosuav@gmail.com>
First post2014-07-13 12:19 +1000
Last post2014-07-13 13:44 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: codingbat question broken? Chris Angelico <rosuav@gmail.com> - 2014-07-13 12:19 +1000
    Re: codingbat question broken? Orochi <kartikjagdale11@gmail.com> - 2014-07-13 13:44 -0700

#74394 — Re: codingbat question broken?

FromChris Angelico <rosuav@gmail.com>
Date2014-07-13 12:19 +1000
SubjectRe: codingbat question broken?
Message-ID<mailman.11782.1405217961.18130.python-list@python.org>
On Sun, Jul 13, 2014 at 12:05 PM, Rodrick Brown <rodrick.brown@gmail.com> wrote:
>
> Can anyone show me an example where all test are success?

No, because that's asking for the answer :) What you need to do is
look at the failing test cases, and figure out why your function is
giving the wrong result. Do you see what's true of all the failing
cases and is not true of any others? That might give you a clue as to
what's wrong.

ChrisA

[toc] | [next] | [standalone]


#74405

FromOrochi <kartikjagdale11@gmail.com>
Date2014-07-13 13:44 -0700
Message-ID<44a21cf0-8de0-48d3-a304-fe98ab3fc327@googlegroups.com>
In reply to#74394
On Sunday, 13 July 2014 07:49:18 UTC+5:30, Chris Angelico  wrote:
> On Sun, Jul 13, 2014 at 12:05 PM, Rodrick Brown <rodrick.brown@gmail.com> wrote:
> 
> >
> 
> > Can anyone show me an example where all test are success?
> 
> 
> 
> No, because that's asking for the answer :) What you need to do is
> 
> look at the failing test cases, and figure out why your function is
> 
> giving the wrong result. Do you see what's true of all the failing
> 
> cases and is not true of any others? That might give you a clue as to
> 
> what's wrong.
> 
> 
> 
> ChrisA



On Sunday, 13 July 2014 07:49:18 UTC+5:30, Chris Angelico  wrote:
> On Sun, Jul 13, 2014 at 12:05 PM, Rodrick Brown <rodrick.brown@gmail.com> wrote:
> 
> >
> 
> > Can anyone show me an example where all test are success?
> 
> 
> 
> No, because that's asking for the answer :) What you need to do is
> 
> look at the failing test cases, and figure out why your function is
> 
> giving the wrong result. Do you see what's true of all the failing
> 
> cases and is not true of any others? That might give you a clue as to
> 
> what's wrong.
> 
> 
> 
> ChrisA

This Is My Code(using Python 2.7)
Its working fine with the given test cases.
#Lucky_Sum
a =[]
def lucky_sum(list):
    t = 0
    for item in list:
        if item == 13:
            break
        else:
            t=t+item
    return t

list=[]
type(list)
n = raw_input("Enter Numebr of item in list: ")
n = int(n)
        
for x in range (0,n):
    list.append(int(raw_input()))
print "List is :",list
        
print lucky_sum(list)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web