This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def generuj_losowe_liczby(ilosc_liczb): | |
return [random.randint(1, 100) for _ in range(ilosc_liczb)] | |
def oblicz_srednia(liczby): | |
return sum(liczby) / len(liczby) if len(liczby) > 0 else 0 | |
# Generuj 10 losowych liczb | |
losowe_liczby = generuj_losowe_liczby(10) |