Ad
  • Custom User Avatar

    Great kata, submitting it was REALLY satisfying!
    Instructions were quite wacky though. At the very start I didn't really know what does outputting mean (. and , instructions) and what I am supposed to return exactly, but after some time I finally understood it. The way _ and | were described is off as well. <, >, ^ and v were described like this: START MOVING to the direction, meanwhile _ and | were described like this: MOVE to the direction while it should be START MOVING to the direction just like in arrows case. Debugging code to fulfill tests requirements was painful as well.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I'm always very impressed when I'm struggling with a kata and then I find such simple solution - great job!

  • Custom User Avatar

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

  • Custom User Avatar

    I didn't know you can convert range to list! Very clever.

  • Custom User Avatar

    That's because you're trying to iterate a NoneType object. Error raises if at least one of these arrays is None. Ciprian and I already explained you it in your previous question.

  • Custom User Avatar

    I forgot to convert balance to integer. Fixed that already :)

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Instead of making such long wall of if statements you could just create a tuple of months, then look for index of month from current_date and expiration_date in this tuple and replace this month with index number.
    For instance:

    Months = ('January', 'February', 'March', 'April', 'May', 'June',
                 'July', 'August', 'September', 'October', 'November', 'December')
    a[0] = months.index(a[0])
    b[0] = months.index(b[0])
    

    I think this way would be easier and less backbreaking.

  • Custom User Avatar

    As I see while looking at others' solution I could use just one return statement at the end of function with Fn1*Fn2 = prod instead of ... == False. Wouldn't have to put if statement inside while loop and check it each time it repeats. My bad. I'm pretty proud of this code tho :)

  • Custom User Avatar

    Instead of making another variable being a result of multiplying first and second you could just use first * second in while and if statements. I think it would be a little bit more efficient since you don't have to store it nor change it's value each time you repeat a loop.

  • Custom User Avatar

    Felt overwhelmed after reading description, but this kata turned to be much easier than expected :) Good one, however I think difficulty rank should be actually around 6 kyu.