Skip to content

Instantly share code, notes, and snippets.

@masters3d
Created January 20, 2015 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masters3d/7427a1f7de4353f7bf71 to your computer and use it in GitHub Desktop.
Save masters3d/7427a1f7de4353f7bf71 to your computer and use it in GitHub Desktop.
problems compare
import json
import urllib2
pythonParsedList = json.load(urllib2.urlopen('https://raw.githubusercontent.com/exercism/xpython/master/config.json'))
swiftParsedList = json.load(urllib2.urlopen('https://raw.githubusercontent.com/exercism/xswift/master/config.json'))
haskellParsedList = json.load(urllib2.urlopen('https://raw.githubusercontent.com/exercism/xhaskell/master/config.json'))
csharpParsedList = json.load(urllib2.urlopen('https://raw.githubusercontent.com/exercism/xcsharp/master/config.json'))
#Python
pythonProblems = pythonParsedList['problems']
swiftProblems = swiftParsedList['problems']
diffProblemsSwiftPython = [item for item in pythonProblems if item not in swiftProblems]
commonProblemsSwiftPython = [item for item in pythonProblems if item in swiftProblems]
diffCommonProblemsSwiftPython = [item for item in swiftProblems if item not in commonProblemsSwiftPython]
#Haskell
haskellProblems = haskellParsedList ['problems']
pythonProblemsDeprecated = pythonParsedList['deprecated']
deprecatedPythonHaskell = [item for item in pythonProblemsDeprecated if item not in haskellProblems]
#Csharp
csharpProblems = csharpParsedList['problems']
diffProblemsSwiftCsharp = [item for item in csharpProblems if item not in swiftProblems]
commonProblemsSwiftCsharp = [item for item in csharpProblems if item in swiftProblems]
diffCommonProblemsSwiftCsharp = [item for item in swiftProblems if item not in commonProblemsSwiftCsharp]
newListToPrint = []
#for each in enumerate(diffProblemsSwiftCsharp) :
#print(each)
for each in diffProblemsSwiftCsharp :
newListToPrint.append([csharpProblems.index(each), each])
print newListToPrint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment