fork download
  1. #!/usr/bin/env python3
  2.  
  3. import re
  4.  
  5. if __name__ == '__main__':
  6. n = 3
  7. row = re.split(r'\W+', input('a, b, c の入力 : \n'))
  8. if len(row) == n:
  9. row = row * 2
  10. for i in range(n):
  11. print(f'{row[0 + i]} {row[1 + i]} {row[2 + i]}')
  12.  
Success #stdin #stdout 0.04s 9472KB
stdin
1, 2, 3
stdout
a, b, c の入力 : 
1 2 3
2 3 1
3 1 2