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

    Curious, i find good numbers but there is a gap in the numerotation....???
    for exemple 100 in the place 92
    The generation of the automorphic number can give more than one for each.
    For exemple is done :
    1
    5
    6
    25
    76
    376
    625
    625
    9376
    9376
    ....
    is 625 number 6 or 7
    or delete one of them

  • 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

    Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license()" for more information.

    m= ("""
    dfllllll
    drrurrdu
    rrlruldu
    rrrrrrru
    """)
    type(m)
    <class 'str'>
    liste=m.splitlines()
    print(liste)
    ['', 'dfllllll', 'drrurrdu', 'rrlruldu', 'rrrrrrru']

    no error

    The robot anwnser :
    File "/workspace/default/solution.py", line 2, in path_counter
    liste=m.splitlines()
    AttributeError: 'list' object has no attribute 'splitlines'

  • 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

    I still not understood : The begin of my program is :
    def path_counter(m):
    liste = m.split()

    m is a string
    The awnser is :
    File "/workspace/default/solution.py", line 2, in path_counter
    liste = m.split()
    AttributeError: 'list' object has no attribute 'split'

  • Custom User Avatar

    curiously no problem with microsoft visual studio ?

  • 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

    it's not very kind...
    I learn python
    you should learn kindess

  • Custom User Avatar

    you should read the documentation about that method

  • Custom User Avatar

    liste=m.split()
    is not accept when more than 2 lines

  • Custom User Avatar

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

  • Custom User Avatar

    I found the solution :
    hex_val='1dc41525'
    print(binascii.a2b_hex(hex_val))

    result=b'\x1d\xc4\x15%'

  • Custom 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.

  • Loading more items...