Ad
  • Custom User Avatar

    This doesn't check that the result is the same as the input. With the example test the 1st and 2nd "l"s from "hello" can be swapped but the result is still "hello"

    simple test I ran (I'm fairly new to python so this might not be the best way to do it)
    for i in range(11):
    print(mix_words('hello'))
    for i in range(11):
    print(mix_words('hello, Pippi!'))

    output:
    hlelo
    hlelo
    hlleo
    hello -- Should fail?
    hlleo
    hello -- Should fail?
    hlleo
    hlleo
    hlelo
    hlleo
    hello -- Should fail?
    hlleo, Ppipi!
    hlleo, Pippi! -- 2nd word should fail?
    hello, Pppii! -- 1st word should fail?
    hlelo, Ppipi!
    hlelo, Pppii!
    hlleo, Ppipi!
    hlleo, Pppii!
    hello, Pppii! -- 1st word should fail?
    hlleo, Ppipi!
    hlleo, Ppipi!
    hello, Pippi! -- Should fail?