We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Bit of a simple question I was also trying to use remove(max(array)). Please could someone explain why
highest = max(array)
while max(array) == highest:
array.remove(max(array))
print(max(array))
works but this won't:
array.remove(max(array))
print(max(array))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →
Bit of a simple question I was also trying to use remove(max(array)). Please could someone explain why
highest = max(array)
while max(array) == highest:
array.remove(max(array))
print(max(array))
works but this won't:
array.remove(max(array))
print(max(array))