fork download
  1. a = ['Н', 'А', 'С', 'Т', 'Я']
  2.  
  3. c = 0
  4. for a1 in a:
  5. for a2 in a:
  6. for a3 in a:
  7. for a4 in a:
  8. for a5 in a:
  9. for a6 in a:
  10. word = a1 + a2 + a3 + a4 + a5 + a6
  11. if word.count('А') < 2 and word.count('Я') < 2:
  12. c += 1
  13. print(c)
  14.  
  15.  
  16.  
Success #stdin #stdout 0.03s 9028KB
stdin
Standard input is empty
stdout
6075