Advertisement
TwiNNeR

snzl4z1

Nov 25th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.99 KB | None | 0 0
  1. oceniPoKorisnici = {
  2.     'Lisa Rose': {'Catch Me If You Can': 3.0, 'Snakes on a Plane': 3.5, 'Superman Returns': 3.5,
  3.                   'You, Me and Dupree': 2.5, 'The Night Listener': 3.0, 'Snitch': 3.0},
  4.     'Gene Seymour': {'Lady in the Water': 3.0, 'Snakes on a Plane': 3.5, 'Just My Luck': 1.5, 'The Night Listener': 3.0,
  5.                      'You, Me and Dupree': 3.5},
  6.     'Michael Phillips': {'Catch Me If You Can': 2.5, 'Lady in the Water': 2.5, 'Superman Returns': 3.5,
  7.                          'The Night Listener': 4.0, 'Snitch': 2.0},
  8.     'Claudia Puig': {'Snakes on a Plane': 3.5, 'Just My Luck': 3.0, 'The Night Listener': 4.5, 'Superman Returns': 4.0,
  9.                      'You, Me and Dupree': 2.5},
  10.     'Mick LaSalle': {'Lady in the Water': 3.0, 'Snakes on a Plane': 4.0, 'Just My Luck': 2.0, 'Superman Returns': 3.0,
  11.                      'You, Me and Dupree': 2.0},
  12.     'Jack Matthews': {'Catch Me If You Can': 4.5, 'Lady in the Water': 3.0, 'Snakes on a Plane': 4.0,
  13.                       'The Night Listener': 3.0, 'Superman Returns': 5.0, 'You, Me and Dupree': 3.5, 'Snitch': 4.5},
  14.     'Toby': {'Snakes on a Plane': 4.5, 'Snitch': 5.0},
  15.     'Michelle Nichols': {'Just My Luck': 1.0, 'The Night Listener': 4.5, 'You, Me and Dupree': 3.5,
  16.                          'Catch Me If You Can': 2.5, 'Snakes on a Plane': 3.0},
  17.     'Gary Coleman': {'Lady in the Water': 1.0, 'Catch Me If You Can': 1.5, 'Superman Returns': 1.5,
  18.                      'You, Me and Dupree': 2.0},
  19.     'Larry': {'Lady in the Water': 3.0, 'Just My Luck': 3.5, 'Snitch': 1.5, 'The Night Listener': 3.5}
  20. }
  21.  
  22.  
  23. def invertirajOceni(oceni):
  24.     result = {}
  25.     for person in oceni:
  26.         for item in oceni[person]:
  27.             result.setdefault(item, {})
  28.             # Zameni gi mestata na licnosta i predmetot
  29.             result[item][person] = oceni[person][item]
  30.     return result
  31.  
  32.  
  33. if __name__ == "__main__":
  34.     oceniPoFilmovi = invertirajOceni(oceniPoKorisnici)
  35.  
  36.     film = input()
  37.  
  38.     print oceniPoFilmovi[film]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement