You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
501 B
21 lines
501 B
#!/usr/bin/env python3 |
|
# -*- coding: utf-8 -*- |
|
|
|
from typing import List |
|
from random import shuffle |
|
|
|
|
|
MIN = -1000 |
|
MAX = 1000 |
|
|
|
|
|
def generate_numbers_list(mini: int, maxi: int) -> List[int]: |
|
"""Generate a list of int between mini and maxi""" |
|
return list(range(mini, maxi+1)) |
|
|
|
def randomise_with_iterator(list_from: List[int]) -> int: |
|
"""Copy and randomize a list to an iterator""" |
|
randomized = list_from.copy() |
|
shuffle(randomized) |
|
while randomized: |
|
yield randomized.pop()
|
|
|