From 3e582d97344601727f66530135ac13d122d13f29 Mon Sep 17 00:00:00 2001 From: Packy Anderson Date: Wed, 6 Dec 2023 01:36:14 -0500 Subject: Challenge 246 solutions by Packy Anderson * Raku * Perl * Python 1 Blog post --- challenge-246/packy-anderson/python/ch-1.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 challenge-246/packy-anderson/python/ch-1.py (limited to 'challenge-246/packy-anderson/python/ch-1.py') diff --git a/challenge-246/packy-anderson/python/ch-1.py b/challenge-246/packy-anderson/python/ch-1.py new file mode 100755 index 0000000000..035378a255 --- /dev/null +++ b/challenge-246/packy-anderson/python/ch-1.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +from random import sample + +def sixOutOfFourtyNine(): + return sorted(sample(range(1, 49), 6)) + +def solution(): + arr = sixOutOfFourtyNine() + print( "\n".join(map(str, arr)) ) + +print('Output') +solution() -- cgit