aboutsummaryrefslogtreecommitdiff
path: root/challenge-331/packy-anderson/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-331/packy-anderson/python/ch-1.py')
-rwxr-xr-xchallenge-331/packy-anderson/python/ch-1.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/challenge-331/packy-anderson/python/ch-1.py b/challenge-331/packy-anderson/python/ch-1.py
new file mode 100755
index 0000000000..c37a04e768
--- /dev/null
+++ b/challenge-331/packy-anderson/python/ch-1.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+def distinctAverages(nums):
+ pass
+
+def last_word(strVal):
+ return len(strVal.split()[-1])
+
+def solution(strVal):
+ print(f'Input: $str = "{strVal}"')
+ print(f'Output: {last_word(strVal)}')
+
+print('Example 1:')
+solution("The Weekly Challenge")
+
+print('\nExample 2:')
+solution(" Hello World ")
+
+print('\nExample 3:')
+solution("Let's begin the fun")