ramsess90

01_list

Jan 19th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. entrance = list(map(float, input().split()))
  2. index = 0
  3.  
  4. while True:
  5.     if index + 1 < len(entrance):
  6.         if entrance[index] == entrance[index + 1]:
  7.             entrance[index] = entrance[index] + entrance[index]
  8.             entrance.pop(index + 1)
  9.             index = -1
  10.     else:
  11.         break
  12.     index += 1
  13. print(' '.join(map(str, entrance)))
Advertisement
Add Comment
Please, Sign In to add comment