Ad
  • Custom User Avatar

    Hangman('E', 'everything') ==> 'e_e_______'

    Random tests consistently generate cases where at least two characters are not present. In fact, most of the test cases generate strings composed of underscores ('_') with random lengths.

  • Custom User Avatar

    Problems with typography and Markdown formatting:

    • Use # heading not ###heading###
    • No need to write headings in uppercase and followed by colon
  • Custom User Avatar

    The description should say what to do about corner cases:

    • empty string given as input
    • invalid locomotive position or multiple locomotives e.g. "_A__B"
    • other characters in the input

    I think the description should simply say:

    You can assume that input will only contain valid trains (i.e. one locomotive followed by coaches).

  • Custom User Avatar

    A few semantics suggestions:
    *delete the line 'The value is supposed to be an integer' and change the top line to be 'Your job is to return the amount of metal (an integer) needed...'
    *change 'The coaches take 5 pieces of metal to make(for each) 'to 'The coaches take 5 pieces of metal each'
    *I'd also suggest your two examples give different results - maybe something like 'D________' which is 48

  • Custom User Avatar

    nice easy problem

  • Custom User Avatar

    It is not clear from the description that the tests expect the output to be entirely lowercase regardless of the case of the input. I would suggest clarifying this in the description.

  • Custom User Avatar

    The trays are collor coded

    collor -> color

  • Custom User Avatar
  • Custom User Avatar
    Traceback (most recent call last):
      File "tests.py", line 1, in <module>
        from solution import Hangman
    ImportError: cannot import name 'Hangman' from 'solution' (/workspace/default/solution.py)
    
  • Custom User Avatar

    duplicate issue

  • Custom User Avatar

    use 3.8

  • Custom User Avatar

    Why is the function called bob ?

  • Custom User Avatar

    This series converges to e-1.

    e = \sum_{k=0}^{\inf} 1/k! starting fom 0 (not 1).

  • Custom User Avatar

    Main issue:

    Floats have limited precision, and are unable to exactly represent all needed values (only 18 different "e values" can be represented).
    https://docs.codewars.com/authoring/kata/floating-point/
    https://docs.python.org/3/tutorial/floatingpoint.html

    It's better to use Fraction or Decimal.

    Other issues:

    • Floats should be compared with test.assert_approx_equals
    • Floats should be summed with fsum, or at least from smaller to bigger.
  • Custom User Avatar

    Binary is just the number system with base 2. It is usually represented as a string in code, but thats not what makes it binary.

  • Loading more items...