Advertisement
DaniDori

Untitled

Dec 23rd, 2020
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. position = 0
  2. count = 0
  3. first = ['Alice', 'Ariel', 'Aurora', 'Phil', 'Olaf', 'Peter', 'Phoebus', 'Ralph', 'Robin']
  4. second = ['Bambi', 'Bolt', 'Belle', 'Mulan', 'Mowgli', 'Mickey', 'Silver', 'Simba', 'Stitch']
  5. third = ['Dumbo', 'Genie', 'Jiminy', 'Kuzko', 'Kida', 'Kenai', 'Tarzan', 'Tiana', 'Winnie']
  6. n = int(input())
  7. for i in range(n):
  8. a = input()
  9. for j in first:
  10. if j == a:
  11. count += position
  12. position = 0
  13. break
  14. for j in second:
  15. if j == a:
  16. count += abs(position - 1)
  17. position = 1
  18. break
  19. for j in second:
  20. if j == a:
  21. count += abs(position - 2)
  22. position = 2
  23. break
  24. print(count)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement