Új hozzászólás Aktív témák

  • olli

    tag

    Sziasztok!
    Abszolut kezdőként kérdezem: IDLE Shell 3.12.6 megnyitom.

    import itertools
    # Define the range of numbers (1 to 90)
    numbers = range(1, 91)
    # Define the target sum
    target_sum = 225
    # Generate all combinations of 5 numbers from the range 1 to 90
    combinations = itertools.combinations(numbers, 5)
    # Filter combinations whose sum equals the target_sum
    valid_combinations = [comb for comb in combinations if sum(comb) == target_sum]
    # Count the number of valid combinations
    num_valid_combinations = len(valid_combinations)
    valid_combinations, num_valid_combinations

    Kódot soronként bemásolom, sorok végén enter.
    Kód lefut, rákérdez a futtatásra.
    Ugyan itt: New File megnyit, kód bemásol, mentés ujmind.py
    Run> Run Module : = RESTART: C:/Users/win11/AppData/Local/Programs/Python/Python312/ujmind.py és semmi..
    Mit csinálok rosszul?

Új hozzászólás Aktív témák