SHARE
TWEET

Untitled

a guest Nov 26th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def listy(liczba, k):
  2.     lista_A = []
  3.     lista_B = []
  4.     i = 0
  5.     for n in range(len(liczba)//(2*k)):
  6.         suma = 0
  7.         for j in range(k):
  8.             suma+=int(liczba[i])
  9.             i+=1
  10.         lista_A.append(suma)
  11.         suma = 0
  12.         for j in range(k):
  13.             suma+=int(liczba[i])
  14.             i+=1
  15.         lista_B.append(suma)
  16.     return lista_A, lista_B
  17.  
  18. liczba = input()
  19. k = int(input())
  20. lista_A, lista_B = listy(liczba, k)
  21. print(lista_A)
  22. print(lista_B)
  23. input()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top