aboutsummaryrefslogtreecommitdiff
path: root/challenge-246/lubos-kolouch/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-246/lubos-kolouch/python/ch-1.py')
-rw-r--r--challenge-246/lubos-kolouch/python/ch-1.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/challenge-246/lubos-kolouch/python/ch-1.py b/challenge-246/lubos-kolouch/python/ch-1.py
new file mode 100644
index 0000000000..7428e5f573
--- /dev/null
+++ b/challenge-246/lubos-kolouch/python/ch-1.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+import random
+from typing import List
+
+
+def pick_lotto_numbers() -> list[int]:
+ return random.sample(range(1, 50), 6)
+
+
+# Test
+import unittest
+
+
+class TestLottoNumbers(unittest.TestCase):
+ def test_lotto_numbers(self):
+ result = pick_lotto_numbers()
+ self.assertEqual(len(result), 6)
+ self.assertEqual(len(set(result)), 6)
+ for num in result:
+ self.assertTrue(1 <= num <= 49)
+
+
+if __name__ == "__main__":
+ unittest.main()
+
+# Main
+for num in sorted(pick_lotto_numbers()):
+ print(num)