fork download
  1. from itertools import combinations
  2. R = ''.join([ str(n) for n in range(1, 9) ])
  3. S = [ ''.join(item) for item in combinations(R, 4) ]
  4. for item in S: print(item)
Success #stdin #stdout 0.02s 8736KB
stdin
Standard input is empty
stdout
1234
1235
1236
1237
1238
1245
1246
1247
1248
1256
1257
1258
1267
1268
1278
1345
1346
1347
1348
1356
1357
1358
1367
1368
1378
1456
1457
1458
1467
1468
1478
1567
1568
1578
1678
2345
2346
2347
2348
2356
2357
2358
2367
2368
2378
2456
2457
2458
2467
2468
2478
2567
2568
2578
2678
3456
3457
3458
3467
3468
3478
3567
3568
3578
3678
4567
4568
4578
4678
5678