Ad
  • Custom User Avatar

    0.66 => 'Correct, it should be [ '1/2', '1/7', '1/59', '1/5163', '1/53307975', '1/9007199254740992' ]' => Not true :-)

  • Custom User Avatar

    @JF: the example tests are misleading, but if you actually read them as a whole, here is what you'll see at the bottom of them:

    ...
    
    
    @test.describe("Testing...")
    def _():
        
        @test.it('Fixed tests')
        def _():
            for case, a in test_case:
                test.assert_equals(path_counter(case.split()), a)
                #                               ^^^^^^^^^^^^
    

    if the description is talking about an array of strings, don't expect the tests to provide anything else, even if, the data is originally stored in a different format for better readability.

  • Custom User Avatar

    The input to the function is not a string. It is a list of strings. List does not have the same methods as a str. When both Blind4Basics and Hobovsky give you a hint, you'd better start believing it.

  • Custom User Avatar

    The conveyor is represented by a rectangular list of strings, as shown below:

    In tests for this kata, m is not a string.

  • Custom User Avatar

    errr, that was actually a fairly neutral comment, sorry it turned out that way... ':)

    What I meant is that you surely use that function the wrong way, so you should go read the documentation about it to understand why it's currently causing problems and how you could use it in more appropriated ways.

    Dealing with documentation is a huge part of learning programming languages so you'd better get used to it asap. I'm actually surprized I was to say it to a 3kyu user... :o

  • Custom User Avatar

    you should read the documentation about that method

  • Default User Avatar

    It says words can have "'" before, after or middle of them, so "'" is of course not a word.

  • Default User Avatar

    i want to change b'0x1d' in \x1d

    you did. you got 29. that's what \x1d is. it's 29. you would append 29 to your bytestring.
    not "29", that's not a number, that is text. 29.
    a bytestring is a bunch of bytes. a byte is an integer. your first byte is 29.

  • Default User Avatar

    I think I might finally see what you're saying

    \x1d is one byte. A byte is 8 bits, it can have one of the values 0..255. So which of 0..255 is \x1d? Maybe start with something simpler, like zero, then one, then two.
    (And there are no backslashes anywhere here, same as how a list doesn't have ['s in it)

  • Default User Avatar

    "1a" probably doesn't encode to b"\x1a" though, right? You can't encode "purple" like that, there's no b"\xpu\xrp\xle"

  • Default User Avatar

    Are you misreading that? There are no backslashes in that string.

    >>> len(b'\x1a\x2b')
    2
    
  • Custom User Avatar

    The description explicitly states:

    It should throw errors for empty strings or strings which don't represent a decimal number.

    You can use try/except if you like, but if you catch an error you need to raise it again to pass the test.

  • Custom User Avatar

    Read the posts below, it's been discussed before. And yes, the sum of divisors of 441 is 300.

  • Default User Avatar

    Same here, too. Strange. But, is it actually, correct? Sum of divisors for 441 is 300, if i am right?

  • Custom User Avatar
  • Loading more items...