From 65934126c70f4a4ef87291a6e7e18d5005d3c7a6 Mon Sep 17 00:00:00 2001 From: Packy Anderson Date: Mon, 9 Sep 2024 02:56:41 -0400 Subject: Challenge 286 solutions by Packy Anderson * Raku that maybe looks like Raku, but mostly like Perl * Perl * Python that definitely looks like Perl * Elixir 1 Blog post --- challenge-286/packy-anderson/python/ch-1.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 challenge-286/packy-anderson/python/ch-1.py (limited to 'challenge-286/packy-anderson/python/ch-1.py') diff --git a/challenge-286/packy-anderson/python/ch-1.py b/challenge-286/packy-anderson/python/ch-1.py new file mode 100755 index 0000000000..bfe31a7b8b --- /dev/null +++ b/challenge-286/packy-anderson/python/ch-1.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python + +from random import randrange + +words = [] +with open(__file__) as fh: + words.extend(fh.read().split()) + +print(f'{ words[ randrange( len(words) ) ] }') \ No newline at end of file -- cgit