Ad
  • Custom User Avatar

    I understand what you mean.

    Actually, I did the re-assignment to the input.

    '#'+s.title().replace(' ','')
    

    s in the above part is still the input.


    s='#'+s.title().replace(' ','')
    

    first s in the above part is the output.


    return s if s!='#' and len(s)<=140 else False
    

    all vairable s in this part are not the input (it's already assigned to new value). Those are the output.


    Sample Test

    you can add this test to the smaple tests. It will work properly 😉.

    Test.describe("Basic tests")
    Test.assert_equals(generate_hashtag('codewars                                                                                          is                                                            nice                                                                                '), '#CodewarsIsNice', 'Should deal with a whole lot of spaces.')
    

    Hope this clear to you.

    Thank you for checking my code 😊

  • Custom User Avatar

    Okay, thank you

  • Custom User Avatar

    alt text
    Please see the picture with the link if the picture doesn't show.
    I want to create this for Lemma number 3.
    Is that right? If my description is so bad, please give some suggestion.

  • Custom User Avatar

    Sorry Sensei. I got it. Thank you😊😊

  • Custom User Avatar

    Sensei, could you please fix the problem?
    I already check these number with calculator and my program is correct.

    Testing: 9671406556917033397649401, expecting: False
    True should equal False

    Testing: 9007199254740993, expecting: False
    True should equal False

    Testing: 2305843009213693954, expecting: False
    True should equal False

    Testing: 316912650057057350374175801348, expecting: False
    True should equal False