Ad
  • Custom User Avatar

    Didn't knew that precision can be that high, thanks!
    BTW I really like your solution ;-)

  • Custom User Avatar

    Hey !

    I always have issues with floats in Python (and most languages), like bad rounding/truncation... So I play with integers (and divide at the end only if needed)

    In this exercise we are playing with too many decimals to be really accurate, so try to implement your while based solution with integers - it should do the trick.

    Cheers

  • Custom User Avatar

    This is only an exercise. I didn't rewrite a router from scratch, it only needed to work - and it does well!
    You should explain why in real life no one should run callback in bind method instead of just writing that : this is not constructive.

  • Custom User Avatar

    Edit: nevermind, with a little optimization it's way faster !!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Same here. According to the link given by the error the author should just add someting like # -*- coding: utf-8 -*- on the first or second line. I've tried to add this at the beggining of my code, it doesn't work. Too bad 'cause I've spent some time in it and I can't get my points. Hope it'll be fixed soon.

    After some tests, adding

    c = VigenereCipher('カタカナ', 'アイウエオァィゥェォカキクケコサシスセソタチツッテトナニヌネノハヒフヘホマミムメモヤャユュヨョラリルレロワヲンー')
    test.assert_equals(c.decode('ドオカセガヨゴザキアニ'),'ドモアリガトゴザイマス')
    

    in test cases throws the same error. Simply adding # -*- coding: utf-8 -*- on the first line of the test cases fixed this.

    If someone could edit to add that snippet it would be great :)

  • Custom User Avatar

    I didn't knew I could add a translation :) thanks for doing it !

    I'll try vol 4 soon ;)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution