Hirdetés
- sziku69: Szólánc.
- Luck Dragon: Asszociációs játék. :)
- Andras-G: Az internet veszélyei [2. rész] - Facebook Marketpalce
- GoodSpeed: Daikin FTXF35E / RXF35F Sensira 3,3 kW Inverteres klíma - a Sztori
- MasterDeeJay: Mi ez a pici videókártya? AMD E9173 teszt
- gban: Ingyen kellene, de tegnapra
- sziku69: Fűzzük össze a szavakat :)
- Geri Bátyó: Agglegénykonyha 14 – Kések, késélezés
- mefistofeles: Az elhízás nem akaratgyengeség!
- Gurulunk, WAZE?!
Új hozzászólás Aktív témák
-
olli
tag
válasz
kovisoft
#4446
üzenetére
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]
# Format the first 299018 valid combinations for Excel
formatted_combinations = "\n".join([",".join(map(str, comb)) for comb in valid_combinations[:299018]])
# Print the formatted combinations for Excel
print(formatted_combinations)
c:\Work\python>python x.py > x.txt
c:\Work\python>type x.txt | find /c /v ""
299018
hiba:
>>> c:\Work\python>python x.py > x.txt
File "<stdin>", line 1
c:\Work\python>python x.py > x.txt
^
SyntaxError: unexpected character after line continuation character
>>> c:\Work\python>type x.txt | find /c /v ""
File "<stdin>", line 1
c:\Work\python>type x.txt | find /c /v ""
^
SyntaxError: unexpected character after line continuation character
>>> 299018
Új hozzászólás Aktív témák
- Lenovo ThinkPad T480 i7-8650U / 16GB / 512GB SSD / FHD Dupla akku Win 11 Pro Szép állapot
- Kingston FURY Beast 32GB DDR4 3200MHz (Beszámítás)
- MEDION Erazer Major X20 Gamer laptop -40% i7-13700HX 16/1TB NVIDIA RTX 4070 8GB QHD 240Hz
- Seagate IronWolf 4TB HDD 100/100 Beszámítás OK!
- Lenovo LOQ 15IRH8 / i5-13500H / RTX 4060 / 16GB / garancia
- GYÖNYÖRŰ iPhone SE 2020 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3920
- GYÖNYÖRŰ iPhone 14 Plus 128GB Starlight -1 ÉV GARANCIA - Kártyafüggetlen, MS4458
- ÁRGARANCIA!Épített KomPhone Ryzen 5 5600X 16/32/64GB RAM RX 7600 8GB GAMER PC termékbeszámítással
- Bomba ár! HP EliteBook 855 G7 - Ryzen 5 4650U I 8GB I 128SSD I 15,6" FHD I Cam I W11 I Gari
- ÁRGARANCIA!Épített KomPhone Ryzen 7 9700X 32/64GB RAM RX 9070 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
