Advertisement
dream_4ild

9-И-2 ex.9

Dec 10th, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Sat Nov 21 20:31:21 2020
  4.  
  5. @author: Sergey
  6. """
  7.  
  8. a=input()
  9. data=[a[0], a[1], a[2], a[3]]
  10. ans=[]
  11. for i in range(4):
  12.     data1=data.copy()
  13.     s1=data[i]
  14.     data1.pop(i)
  15.     for j in range(3):
  16.         data2=data1.copy()
  17.         s2=data1[j]
  18.         data2.pop(j)
  19.         for k in range(2):
  20.             data3=data2.copy()
  21.             s3=data2[k]
  22.             data3.pop(k)
  23.             s4=data3.pop(0)
  24.             ans.append(s1+s2+s3+s4)
  25. ans1=list(set(ans))
  26. print(len(ans1))
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement