Exemple #1
0
import random
from timeit import Timer

from questions import get_biggest_and_lowest_value

if __name__ == '__main__':
    numbers = []
    for _ in range(1000000):
        numbers.append(random.uniform(1, 100))

    t = Timer(lambda: get_biggest_and_lowest_value(numbers))
    print(t.timeit(number=1))
Exemple #2
0
 def test_get_biggest_and_lowest_value(self):
     numbers = [0.34, 7, 90, 3, 0.002, 1, 67]
     assert_equal((0.002, 90), get_biggest_and_lowest_value(numbers))
import random
from timeit import Timer

from questions import get_biggest_and_lowest_value


if __name__ == '__main__':
    numbers = []
    for _ in range(1000000):
        numbers.append(random.uniform(1, 100))

    t = Timer(lambda: get_biggest_and_lowest_value(numbers))
    print(t.timeit(number=1))

Exemple #4
0
 def test_get_biggest_and_lowest_value(self):
     numbers = [0.34, 7, 90, 3, 0.002, 1, 67]
     assert_equal((0.002, 90), get_biggest_and_lowest_value(numbers))