Skip to content

Instantly share code, notes, and snippets.

@mediaczar
Created September 18, 2013 09:27
Show Gist options
  • Select an option

  • Save mediaczar/6606734 to your computer and use it in GitHub Desktop.

Select an option

Save mediaczar/6606734 to your computer and use it in GitHub Desktop.
I'm confused by a bit of Python iteration; it looks extremely terse & useful, but I can't see what's happening.
#!/usr/bin/env python
from instagram.client import InstagramAPI
access_token = '[this space intentionally left blank]'
api = InstagramAPI(access_token=access_token)
recent_media, next = api.user_recent_media() # What's happening here? I don't understand syntax
@nicokruithof
Copy link

Python probably returns a pair [element, remainder of the list]. You split it in two variables with this assignment.

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