blob: 23f26726b5916dd975b57520b87d2524fca4df3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!python
#
# Perl Weekly Challenge 330
# Task 2
#
# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-330>
#
import sys
# task implementation
# the return value will be printed
def task_2( args ):
parts = []
for current in args :
if len( current ) >= 3 :
current = current.title()
else:
current = current.lower()
parts.append( current )
return ' '.join( parts )
# invoke the main without the command itself
if __name__ == '__main__':
print( task_2( sys.argv[ 1: ] ) )
|