diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-07-22 00:44:04 +0100 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-07-22 00:44:04 +0100 |
| commit | c5ca130343e62834e6079e43b5cb9588ce0243b1 (patch) | |
| tree | 181a67d80a7c27d84101f21a9fe2f58435475344 /challenge-331/eric-cheung/python/ch-1.py | |
| parent | 1131559ab4a8d9a87b099304a8629deea0b4b0a1 (diff) | |
| download | perlweeklychallenge-club-c5ca130343e62834e6079e43b5cb9588ce0243b1.tar.gz perlweeklychallenge-club-c5ca130343e62834e6079e43b5cb9588ce0243b1.tar.bz2 perlweeklychallenge-club-c5ca130343e62834e6079e43b5cb9588ce0243b1.zip | |
- Added solutions by Eric Cheung.
- Added solutions by Ulrich Rieke.
- Added solutions by Lukas Mai.
- Added solutions by Andrew Shitov.
- Added solutions by Feng Chang.
- Added solutions by Alexander Karelas.
- Added solutions by Simon Proctor.
- Added solutions by E. Choroba.
- Added solutions by Andreas Mahnke.
- Added solutions by Kjetil Skotheim.
- Added solutions by PokGoPun.
- Added solutions by W. Luis Mochan.
- Added solutions by Mark Anderson.
- Added solutions by David Ferrone.
- Added solutions by Peter Meszaros.
- Added solutions by Thomas Kohler.
- Added solutions by Peter Campbell Smith.
Diffstat (limited to 'challenge-331/eric-cheung/python/ch-1.py')
| -rwxr-xr-x | challenge-331/eric-cheung/python/ch-1.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-331/eric-cheung/python/ch-1.py b/challenge-331/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..a7d0dcd351 --- /dev/null +++ b/challenge-331/eric-cheung/python/ch-1.py @@ -0,0 +1,12 @@ +
+import re
+
+## strInput = "The Weekly Challenge" ## Example 1
+## strInput = " Hello World " ## Example 2
+strInput = "Let's begin the fun" ## Example 3
+
+strOutput = re.sub(r"\s+", " ", strInput).strip()
+
+arrOutput = [strLoop for strLoop in strOutput.split(" ") if strLoop]
+
+print (len(arrOutput[-1]))
|
