Ad
  • Custom User Avatar

    looking at other's solutions i feel retarded. I always overthink things...

  • Default User Avatar

    Thanks for your post.

    Do NOT use any of the following words (although they are not strictly Python reserved words, they conflict with the names of commonly-used Python functions):
    
    Data	Float	Int	array	close	float	int	input open	range	type	write	zeros
    

    You could use nested function when possible.
    Happy you found the reason :-)

  • Custom User Avatar

    solved, was being retarded. Didn't notice that i defined a function called range, which your code tried to call instead of python's range. Thanks for your patience.

  • Custom User Avatar

    used 3.4.3. I can send you my code if you want.

  • Default User Avatar

    OK. I see the line in the tests. But AFAIK range in 3.x takes 2 arguments as well as in 2.7 so I don't understand why you got this TypeError. I tried different solutions with the different proposed versions of Python (2.7.6, 3.4.3, 3.6.0) for this kata and had no problem. Which version did you use? As I can see CW proposes the 3.4.3.
    Small note: no need to downvote my post. It doesn't make things easier.

  • Custom User Avatar

    Traceback (most recent call last):
    File "main.py", line 75, in
    randomTests()
    File "main.py", line 70, in randomTests
    for x in range(0, 50):
    TypeError: range() takes 1 positional argument but 2 were given

    i've no such code in my solution.

  • Default User Avatar

    454 guys passed the Python kata; I just tried several solutions and had no problem. So I think it is not an issue of the kata but maybe a problem in your code.

  • Custom User Avatar

    Tests for this kata fail. randomTests.py for x in range(0, 50) takes too many positional arguments according to the tracklog, line 70. (maybe python2 vs python3, i wouldn't know.)
    Can't submit my answer until it's fixed.