Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. the_list = [1,12,2,3,1,1,2,3,1,3,4,3,1,5,0,3,2,13,1,19,1,19,9,23,1,5,23,27,1,27,9,31,1,6,31,35,2,35,9,39,1,39,6,43,2,9,43,47,1,47,6,51,2,51,9,55,1,5,55,59,2,59,6,63,1,9,63,67,1,67,10,71,1,71,13,75,2,13,75,79,1,6,79,83,2,9,83,87,1,87,6,91,2,10,91,95,2,13,95,99,1,9,99,103,1,5,103,107,2,9,107,111,1,111,5,115,1,115,5,119,1,10,119,123,1,13,123,127,1,2,127,131,1,131,13,0,99,2,14,0,0]
  2.  
  3.  
  4. first = 0
  5. forth = 4
  6.  
  7.  
  8. cunt = the_list[first:forth]
  9. while 99 not in cunt:
  10.     cunt = the_list[first:forth]
  11.     if cunt[0]==1:
  12.         the_list[cunt[3]]=the_list[cunt[1]]+the_list[cunt[2]]
  13.     if cunt[0]==2:
  14.         the_list[cunt[3]]=the_list[cunt[1]]+the_list[cunt[2]]
  15.     first +=4
  16.     forth +=4
  17.     print(cunt)
  18. print(the_list)
  19. ~                                                                                  
  20. ~                                                                                  
  21. ~                                                                                  
  22. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement