FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Weekly Challenge: The one liners
NewsProgramming Languages

Weekly Challenge: The one liners

via Dev.to PythonSimon Green1mo ago

Weekly Challenge 362 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: Echo Chamber Task You are given a string containing lowercase letters. Write a script to transform the string based on the index position of each character (starting from 0 ). For each character at position i , repeat it i + 1 times. My solution Both of this weeks solutions are a one-liner in Python. For this task, the function is def echo_chamber ( input_string : str ) -> str : return '' . join ( letter * pos for pos , letter in enumerate ( input_string , start = 1 ) ) Multiplying a string ( letter ) by an integer ( pos ) will repeat the string the specified number of times. The enumer

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
13 views

Related Articles

The Artemis Moon base project is legally dubious
News

The Artemis Moon base project is legally dubious

The Verge • 15h ago

The HP OmniBook 5 Is a MacBook Neo Killer, and It's Only $500
News

The HP OmniBook 5 Is a MacBook Neo Killer, and It's Only $500

Wired • 16h ago

Trump defunding of NPR and PBS blocked by judge, but damage is already done
News

Trump defunding of NPR and PBS blocked by judge, but damage is already done

Ars Technica • 17h ago

Everything is iPhone now
News

Everything is iPhone now

The Verge • 17h ago

Terms & Conditions: Soundboks Giveaway
News

Terms & Conditions: Soundboks Giveaway

Wired • 17h ago

Discover More Articles