Skip to content

Commit

Permalink
correct code but runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
innovationchef committed May 14, 2016
1 parent 0bb8959 commit f3e52f5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion movie_weekend.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,23 @@ def getmin(listing, rate_list):
product = length_list[j]*rating_list[j]
product_list.append(product)
j += 1
print(getmin(product_list, rating_list))


index_pos = []
max_prod = max(product_list)
for k in range(0,n):
if(product_list[k]==max_prod):
index_pos.append(k)

new_list = []
new_rating_list = []
for l in range(0,len(index_pos)):
new_list.append(product_list[index_pos[l]])
new_rating_list.append(rating_list[index_pos[l]])

# for g in new_list : print g
m = getmin(new_list, new_rating_list)
print(index_pos[m])
# for p in product_list: print p


Expand Down

0 comments on commit f3e52f5

Please sign in to comment.