fork download
  1. a = "qwe"
  2.  
  3. mask = []
  4. for i in range(len(a) * 2 + 2):
  5. temp = []
  6. for k in f"{i:0{len(a)}b}":
  7. temp.append(bool(int(k)))
  8. mask.append(temp)
  9.  
  10. for i in mask:
  11. s = ''
  12. for k in range(len(a)):
  13. s += a[k].upper() if i[k] else a[k]
  14. print(s)
Success #stdin #stdout 0.02s 9308KB
stdin
Standard input is empty
stdout
qwe
qwE
qWe
qWE
Qwe
QwE
QWe
QWE