
Happy 7th birthday TWC!
Weekly Challenge 366 It was seven years ago that Mohammad sent out the first challenge to Team PWC (as it was then known). Thank you very much for all your work over the seven years. Each week Mohammad S. Anwar sends out The Weekly Challenge , a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. Unless otherwise stated, Copilot (and other AI tools) have NOT been used to generate the solution. It's a great way for us all to practice some coding. Challenge , My solutions Task 1: Count Prefixes Task You are given an array of words and a string (contains only lowercase English letters). Write a script to return the number of words in the given array that are a prefix of the given string. My solution This is a one-liner in Python. It should be pretty self-explanatory. Given a list called array and a string called prefix , it counts the number of items in the list where the first letters of the prefix matc
Continue reading on Dev.to Python
Opens in a new tab




