Új hozzászólás Aktív témák
-
olli
tag
Sziasztok!
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)
A fenti táblázat 299018 sora helyett csak 9030 sort kaptam vissza. Ez korlát, vagy valahol be kell állítani?
Új hozzászólás Aktív témák
- MacBook Pro 13" M1 16GB RAM/ 1TB SSD 27%-os ÁFÁS - 0429AB
- Telefon felvásárlás!! iPhone 15/iPhone 15 Plus/iPhone 15 Pro/iPhone 15 Pro Max
- Telefon felvásárlás!! iPhone 12 Mini/iPhone 12/iPhone 12 Pro/iPhone 12 Pro Max
- Nvidia Quadro és AMD FirePro kártyák - számla, 6 hó gar.
- Apple iPhone 15 Pro 128GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
