diff options
Diffstat (limited to 'challenge-246/luca-ferrari/python/ch-1.py')
| -rw-r--r-- | challenge-246/luca-ferrari/python/ch-1.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/challenge-246/luca-ferrari/python/ch-1.py b/challenge-246/luca-ferrari/python/ch-1.py new file mode 100644 index 0000000000..98b32d6125 --- /dev/null +++ b/challenge-246/luca-ferrari/python/ch-1.py @@ -0,0 +1,28 @@ +#!python + +# +# Perl Weekly Challenge 246 +# Task 1 +# +# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-246/> +# + +import sys +import random + +# task implementation +def main( argv ): + values = [] + while len( values ) < 6: + current_value = random.randint( 1, 49 ) + if not current_value in values: + values.append( current_value ) + + print( "\n".join( map( str, values ) ) ) + + +# invoke the main without the command itself +if __name__ == '__main__': + main( sys.argv[ 1: ] ) + + |
