Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1.  
  2. S = input()
  3. A = S.split(' ')
  4. newS = []
  5. for i in range(len(A)):
  6.     if i % 3 != 0:
  7.         newS.append(A[i])
  8. print (newS)
  9.  
  10.  
  11.  
  12. H = input()
  13. A = H.split(' ')
  14. newH = []
  15. for i in range(len(A)):
  16.     if i % 3 != 0:
  17.         newH.append(A[i])
  18. print (newH)
  19.  
  20.  
  21.  
  22. xfinal = []
  23. yfinal = []
  24. for e in newS:
  25.     if e in newH and e.isdigit() == False:
  26.          xfinal.append(newS[newS.index(e)+1])
  27.          yfinal.append(newH[newH.index(e)+1])
  28. print (xfinal)
  29. print (yfinal)
  30.  
  31. import matplotlib.pyplot as plt
  32. fig, ax = plt.subplots()
  33. ax.bar(xfinal, yfinal, label="")
  34. ax.legend()
  35. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement