• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
1b8 Avatar
Name:Unknown
Clan:Unknown
Member Since:Jul 2015
Last Seen:Feb 2019
Profiles:
Following:0
Followers:0
Allies:0
View Profile Badges
Ad
Educator, struggling to assess your students?
Assess your classroom or bootcamp with the world leading assessment platform, Qualified.Request your demo today!
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (30)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • rowcased
    • commented on "A Needle in the Haystack" python solution
    • 12 months ago

    please do not post solutions in the discourse, otherwise anyone can see it without the spoiler flag. I have added the flag to your comment.

  • Custom User Avatar
    • TheDevDude
    • commented on "A Needle in the Haystack" python solution
    • 12 months ago

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

  • Custom User Avatar
    • adityaprog
    • commented on "A Needle in the Haystack" python solution
    • 2 years ago

    What if needle does not exist in haystack ?!

  • Custom User Avatar
    • Juanbkt
    • commented on "A Needle in the Haystack" python solution
    • 2 years ago

    saving a line break, does it really make the code faster? xD

  • Custom User Avatar
    • The Gentleman
    • commented on "A Needle in the Haystack" python solution
    • 2 years ago

    Wow, didn't know you could define a function with an output in one line.

  • Custom User Avatar
    • Luk-ESC
    • commented on "Transform To Prime" python solution
    • 2 years ago

    Probably the best solution

  • Custom User Avatar
    • Syd7777
    • commented on "A Needle in the Haystack" python solution
    • 2 years ago

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

  • Custom User Avatar
    • dev333
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    The one example you showed using f string doesn't seems to work for me.

    Update : sorry I should have put double quotation "needle" instead of 'needle'

  • Custom User Avatar
    • writeblankspace
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    I do the exact same thing then see someone being cleverer as always. I learn so much from this website! Also lambda would be even shorter

  • Custom User Avatar
    • Encription0001
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    Actually it was the same for me but looking at other peoples solutions actually improved my future solutions... this website is one of the most helpful things ive used

  • Custom User Avatar
    • sid114
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    its the pythonic way to do it

    its sometimes more readable

  • Custom User Avatar
    • Ulin
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    Says the guy who did it in one line

  • Custom User Avatar
    • lahongvy
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    Because it looks like we are pros I think =))

  • Custom User Avatar
    • trustvaldemar
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    Why do people always so depserately try to do it in 1 line?

  • Custom User Avatar
    • JonasFreck
    • commented on "A Needle in the Haystack" python solution
    • 3 years ago

    I assume it has something to do with it being simpler, however realisticly I think it makes it harder to read, not sure, probably also something to do with the single line looking more efficient at a glance, despite being the same output in the same amount of code as lower ones. Just a guess though.

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...