Skip to content

Instantly share code, notes, and snippets.

@imsickofmaps
Created July 5, 2013 08:31
Show Gist options
  • Select an option

  • Save imsickofmaps/5932957 to your computer and use it in GitHub Desktop.

Select an option

Save imsickofmaps/5932957 to your computer and use it in GitHub Desktop.
max_id = [] # Variable to hold the max question id for menu endpoint
for i in range(len(quiz_ids)):
# Need to store end point for main_menu
max_id.append(quiz_ids[i].data["id"])
max_id = max(max_id)
@vhata
Copy link
Copy Markdown

vhata commented Jul 5, 2013

max_id = max([quiz_ids[i].data["id"] for i in quiz_ids])

@vhata
Copy link
Copy Markdown

vhata commented Jul 5, 2013

or:

max_id = max([i.data["id"] for i in quiz_ids])

depending on the structure of quiz_ids.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment