Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getTopRatedMovies (movies):
- top10 = []
- i = 1
- while i < len(movies):
- j = i
- while j > 0 and movies[j-1][1] < movies[j][1]:
- movies[j], movies[j-1] = movies[j-1], movies[j]
- j -= 1
- i += 1
- print (movies[0][0], ':', movies[0][1])
- print (movies[1][0], ':', movies[1][1])
- print (movies[2][0], ':', movies[2][1])
- for i in range(0,len(top10)):
- top10.append(movies[i])
- print (movies[i][1])
- return top10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement