fork download
  1. count = sum(
  2. 1
  3. for n in range(315, 889)
  4. if sum(int(d) for d in str(n)) == 18
  5. )
  6. print(count) # → 38
  7.  
Success #stdin #stdout 0.11s 14148KB
stdin
Standard input is empty
stdout
38