- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Xiaomi 17 Ultra - jó az optikája
- Garmin Venu 4 - a nagy ugrás
- Hamarosan körbefotózza a Google a Balatont
- Milyen okostelefont vegyek?
- iPhone topik
- OnePlus 15 - van plusz energia
- Yettel topik
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Poco X3 Pro - hardverfrissítés
Ú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
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Vezetékes FÜLhallgatók
- Elektromos autók - motorok
- Milyen monitort vegyek?
- Xiaomi 17 Ultra - jó az optikája
- Azonnali informatikai kérdések órája
- Samsung Galaxy Felhasználók OFF topicja
- BestBuy topik
- exHWSW - Értünk mindenhez IS
- Gitáros topic
- További aktív témák...
- 230 - Lenovo Legion 5 (15IRX10) - Intel Core i7-13650HX, RTX 5060
- HIBÁTLAN iPhone 15 Plus 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS4504
- ÁRGARANCIA!Épített KomPhone Ryzen 7 9800X3D 64GB RAM RTX 5080 16GB GAMER PC termékbeszámítással
- ÚJ Bontatlan Honor X7d 6/128GB fekete/ 12 hónap jótállással!
- iPhone 15 Pro Max 256GB 100% (1év Garancia)- ÚJ EREDETI AKKUMULÁTOR - AKCIÓ
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


