Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.1.1
>>> test = ["EARTH 121/EARTH 121L/EARTH 122/EARTH 122L/EARTH 153/CIVE 153/CIVE 253/GEOE 153/ENVE 153",
... "PHYS 112/PHYS 122/PHYS 125",
... "CHEM 254/EARTH 421/CHEM 350",
... "PHYS 112/PHYS 122/PHYS 125, MATH 118/MATH 119/MATH 128/MATH 138/MATH 148, AMATH 250/AMATH 350/CIVE 222/ENVE 223/MATH 218/AMATH 228/ME 203/SYDE 211",
... "PSCI 250/PSCI 255/PSCI 260/PSCI 264",
... "ANTH 201/CLAS 221/ANTH 203/ANTH 233",
... "MATH 135/MATH 145/STAT 220/MATH 230/MATH 240",
... "AMATH 250, MATH 237/MATH 247Level 3A",
... "BIOL 140/BIOL 140L/BIOL 208/BIOL 330, BIOL 308/BIOL 330",
... "CS 240/SE 240/CS 246/ECE 222",
... "CS 246/SE 240/CS 240",
... "AMATH 341/CM 271/CS 371/CS 370, MATH 128/MATH 138/MATH 148",
... "MATH 135/MATH 145/STAT 220/MATH 230/MATH 240",
... "AMATH 250, MATH 237",
... "BIOL 140/BIOL 208/BIOL 330, BIOL 308/BIOL 330",
... "MATH 229/MATH 239/MATH 249, CO 227/CO 250/CO 350/CO 355/CO 352/CM 340",
... "CS 240/SE 240/CS 246/ECE 222",
... "CS 241, STAT 206/STAT 230/STAT 240"]
>>> l = test[0].split(',')
>>> l
0: ['EARTH 121/EARTH 121L/EARTH 122/EARTH 122L/EARTH 153/CIVE 153/CIVE 253/GEOE 153/ENVE 153']
>>> test[0]
1: 'EARTH 121/EARTH 121L/EARTH 122/EARTH 122L/EARTH 153/CIVE 153/CIVE 253/GEOE 153/ENVE 153'
>>> group = []
... for s in l:
... group.append(s.split('/'))
>>> group
2: [['EARTH 121',
'EARTH 121L',
'EARTH 122',
'EARTH 122L',
'EARTH 153',
'CIVE 153',
'CIVE 253',
'GEOE 153',
'ENVE 153']]
>>> for t in test:
... l = t.split(',')
... group = []
... for s in l:
... group.append(s.split('/'))
... print group
[['EARTH 121', 'EARTH 121L', 'EARTH 122', 'EARTH 122L', 'EARTH 153', 'CIVE 153', 'CIVE 253', 'GEOE 153', 'ENVE 153']]
[['PHYS 112', 'PHYS 122', 'PHYS 125']]
[['CHEM 254', 'EARTH 421', 'CHEM 350']]
[['PHYS 112', 'PHYS 122', 'PHYS 125'], [' MATH 118', 'MATH 119', 'MATH 128', 'MATH 138', 'MATH 148'], [' AMATH 250', 'AMATH 350', 'CIVE 222', 'ENVE 223', 'MATH 218', 'AMATH 228', 'ME 203', 'SYDE 211']]
[['PSCI 250', 'PSCI 255', 'PSCI 260', 'PSCI 264']]
[['ANTH 201', 'CLAS 221', 'ANTH 203', 'ANTH 233']]
[['MATH 135', 'MATH 145', 'STAT 220', 'MATH 230', 'MATH 240']]
[['AMATH 250'], [' MATH 237', 'MATH 247Level 3A']]
[['BIOL 140', 'BIOL 140L', 'BIOL 208', 'BIOL 330'], [' BIOL 308', 'BIOL 330']]
[['CS 240', 'SE 240', 'CS 246', 'ECE 222']]
[['CS 246', 'SE 240', 'CS 240']]
[['AMATH 341', 'CM 271', 'CS 371', 'CS 370'], [' MATH 128', 'MATH 138', 'MATH 148']]
[['MATH 135', 'MATH 145', 'STAT 220', 'MATH 230', 'MATH 240']]
[['AMATH 250'], [' MATH 237']]
[['BIOL 140', 'BIOL 208', 'BIOL 330'], [' BIOL 308', 'BIOL 330']]
[['MATH 229', 'MATH 239', 'MATH 249'], [' CO 227', 'CO 250', 'CO 350', 'CO 355', 'CO 352', 'CM 340']]
[['CS 240', 'SE 240', 'CS 246', 'ECE 222']]
[['CS 241'], [' STAT 206', 'STAT 230', 'STAT 240']]
>>> import itertools
>>> itertools.permutations([['AMATH 250'], [' MATH 237']], 2)
3: <itertools.permutations object at 0x02426BD0>
>>> list(itertools.permutations([['AMATH 250'], [' MATH 237']], 2))
4: [(['AMATH 250'], [' MATH 237']), ([' MATH 237'], ['AMATH 250'])]
>>> list(itertools.combinations([['AMATH 250'], [' MATH 237']], 2))
5: [(['AMATH 250'], [' MATH 237'])]
>>> list(itertools.combinations([['CS 241'], [' STAT 206', 'STAT 230', 'STAT 240']], 2))
6: [(['CS 241'], [' STAT 206', 'STAT 230', 'STAT 240'])]
>>> a = [['CS 241'], [' STAT 206', 'STAT 230', 'STAT 240']]
>>> list(itertools.product(*a))
7: [('CS 241', ' STAT 206'), ('CS 241', 'STAT 230'), ('CS 241', 'STAT 240')]
>>> for t in test:
... l = t.split(', ')
... group = []
... for s in l:
... group.append(s.split('/'))
... list(itertools.product(*group))
8: [('CS 241', 'STAT 206'), ('CS 241', 'STAT 230'), ('CS 241', 'STAT 240')]
>>> for t in test:
... l = t.split(', ')
... group = []
... for s in l:
... group.append(s.split('/'))
... print list(itertools.product(*group))
[('EARTH 121',), ('EARTH 121L',), ('EARTH 122',), ('EARTH 122L',), ('EARTH 153',), ('CIVE 153',), ('CIVE 253',), ('GEOE 153',), ('ENVE 153',)]
[('PHYS 112',), ('PHYS 122',), ('PHYS 125',)]
[('CHEM 254',), ('EARTH 421',), ('CHEM 350',)]
[('PHYS 112', 'MATH 118', 'AMATH 250'), ('PHYS 112', 'MATH 118', 'AMATH 350'), ('PHYS 112', 'MATH 118', 'CIVE 222'), ('PHYS 112', 'MATH 118', 'ENVE 223'), ('PHYS 112', 'MATH 118', 'MATH 218'), ('PHYS 112', 'MATH 118', 'AMATH 228'), ('PHYS 112', 'MATH 118', 'ME 203'), ('PHYS 112', 'MATH 118', 'SYDE 211'), ('PHYS 112', 'MATH 119', 'AMATH 250'), ('PHYS 112', 'MATH 119', 'AMATH 350'), ('PHYS 112', 'MATH 119', 'CIVE 222'), ('PHYS 112', 'MATH 119', 'ENVE 223'), ('PHYS 112', 'MATH 119', 'MATH 218'), ('PHYS 112', 'MATH 119', 'AMATH 228'), ('PHYS 112', 'MATH 119', 'ME 203'), ('PHYS 112', 'MATH 119', 'SYDE 211'), ('PHYS 112', 'MATH 128', 'AMATH 250'), ('PHYS 112', 'MATH 128', 'AMATH 350'), ('PHYS 112', 'MATH 128', 'CIVE 222'), ('PHYS 112', 'MATH 128', 'ENVE 223'), ('PHYS 112', 'MATH 128', 'MATH 218'), ('PHYS 112', 'MATH 128', 'AMATH 228'), ('PHYS 112', 'MATH 128', 'ME 203'), ('PHYS 112', 'MATH 128', 'SYDE 211'), ('PHYS 112', 'MATH 138', 'AMATH 250'), ('PHYS 112', 'MATH 138', 'AMATH 350'), ('PHYS 112', 'MATH 138', 'CIVE 222'), ('PHYS 112', 'MATH 138', 'ENVE 223'), ('PHYS 112', 'MATH 138', 'MATH 218'), ('PHYS 112', 'MATH 138', 'AMATH 228'), ('PHYS 112', 'MATH 138', 'ME 203'), ('PHYS 112', 'MATH 138', 'SYDE 211'), ('PHYS 112', 'MATH 148', 'AMATH 250'), ('PHYS 112', 'MATH 148', 'AMATH 350'), ('PHYS 112', 'MATH 148', 'CIVE 222'), ('PHYS 112', 'MATH 148', 'ENVE 223'), ('PHYS 112', 'MATH 148', 'MATH 218'), ('PHYS 112', 'MATH 148', 'AMATH 228'), ('PHYS 112', 'MATH 148', 'ME 203'), ('PHYS 112', 'MATH 148', 'SYDE 211'), ('PHYS 122', 'MATH 118', 'AMATH 250'), ('PHYS 122', 'MATH 118', 'AMATH 350
'), ('PHYS 122', 'MATH 118', 'CIVE 222'), ('PHYS 122', 'MATH 118', 'ENVE 223'), ('PHYS 122', 'MATH 118', 'MATH 218'), ('PHYS 122', 'MATH 118', 'AMATH 228'), ('PHYS 122', 'MATH 118', 'ME 203'), ('PHYS 122', 'MATH 118', 'SYDE 211'), ('PHYS 122', 'MATH 119', 'AMATH 250'), ('PHYS 122', 'MATH 119', 'AMATH 350'), ('PHYS 122', 'MATH 119', 'CIVE 222'), ('PHYS 122', 'MATH 119', 'ENVE 223'), ('PHYS 122', 'MATH 119', 'MATH 218'), ('PHYS 122', 'MATH 119', 'AMATH 228'), ('PHYS 122', 'MATH 119', 'ME 203'), ('PHYS 122', 'MATH 119', 'SYDE 211'), ('PHYS 122', 'MATH 128', 'AMATH 250'), ('PHYS 122', 'MATH 128', 'AMATH 350'), ('PHYS 122', 'MATH 128', 'CIVE 222'), ('PHYS 122', 'MATH 128', 'ENVE 223'), ('PHYS 122', 'MATH 128', 'MATH 218'), ('PHYS 122', 'MATH 128', 'AMATH 228'), ('PHYS 122', 'MATH 128', 'ME 203'), ('PHYS 122', 'MATH 128', 'SYDE 211'), ('PHYS 122', 'MATH 138', 'AMATH 250'), ('PHYS 122', 'MATH 138', 'AMATH 350'), ('PHYS 122', 'MATH 138', 'CIVE 222'), ('PHYS 122', 'MATH 138', 'ENVE 223'), ('PHYS 122', 'MATH 138', 'MATH 218'), ('PHYS 122', 'MATH 138', 'AMATH 228'), ('PHYS 122', 'MATH 138', 'ME 203'), ('PHYS 122', 'MATH 138', 'SYDE 211'), ('PHYS 122', 'MATH 148', 'AMATH 250'), ('PHYS 122', 'MATH 148', 'AMATH 350'), ('PHYS 122', 'MATH 148', 'CIVE 222'), ('PHYS 122', 'MATH 148', 'ENVE 223'), ('PHYS 122', 'MATH 148', 'MATH 218'), ('PHYS 122', 'MATH 148', 'AMATH 228'), ('PHYS 122', 'MATH 148', 'ME 203'), ('PHYS 122', 'MATH 148', 'SYDE 211'), ('PHYS 125', 'MATH 118', 'AMATH 250'), ('PHYS 125', 'MATH 118', 'AMATH 350'), ('PHYS 125', 'MATH 118', 'CIVE 222'), ('PHYS 125', 'MATH 118', 'ENVE 22
3'), ('PHYS 125', 'MATH 118', 'MATH 218'), ('PHYS 125', 'MATH 118', 'AMATH 228'), ('PHYS 125', 'MATH 118', 'ME 203'), ('PHYS 125', 'MATH 118', 'SYDE 211'), ('PHYS 125', 'MATH 119', 'AMATH 250'), ('PHYS 125', 'MATH 119', 'AMATH 350'), ('PHYS 125', 'MATH 119', 'CIVE 222'), ('PHYS 125', 'MATH 119', 'ENVE 223'), ('PHYS 125', 'MATH 119', 'MATH 218'), ('PHYS 125', 'MATH 119', 'AMATH 228'), ('PHYS 125', 'MATH 119', 'ME 203'), ('PHYS 125', 'MATH 119', 'SYDE 211'), ('PHYS 125', 'MATH 128', 'AMATH 250'), ('PHYS 125', 'MATH 128', 'AMATH 350'), ('PHYS 125', 'MATH 128', 'CIVE 222'), ('PHYS 125', 'MATH 128', 'ENVE 223'), ('PHYS 125', 'MATH 128', 'MATH 218'), ('PHYS 125', 'MATH 128', 'AMATH 228'), ('PHYS 125', 'MATH 128', 'ME 203'), ('PHYS 125', 'MATH 128', 'SYDE 211'), ('PHYS 125', 'MATH 138', 'AMATH 250'), ('PHYS 125', 'MATH 138', 'AMATH 350'), ('PHYS 125', 'MATH 138', 'CIVE 222'), ('PHYS 125', 'MATH 138', 'ENVE 223'), ('PHYS 125', 'MATH 138', 'MATH 218'), ('PHYS 125', 'MATH 138', 'AMATH 228'), ('PHYS 125', 'MATH 138', 'ME 203'), ('PHYS 125', 'MATH 138', 'SYDE 211'), ('PHYS 125', 'MATH 148', 'AMATH 250'), ('PHYS 125', 'MATH 148', 'AMATH 350'), ('PHYS 125', 'MATH 148', 'CIVE 222'), ('PHYS 125', 'MATH 148', 'ENVE 223'), ('PHYS 125', 'MATH 148', 'MATH 218'), ('PHYS 125', 'MATH 148', 'AMATH 228'), ('PHYS 125', 'MATH 148', 'ME 203'), ('PHYS 125', 'MATH 148', 'SYDE 211')]
[('PSCI 250',), ('PSCI 255',), ('PSCI 260',), ('PSCI 264',)]
[('ANTH 201',), ('CLAS 221',), ('ANTH 203',), ('ANTH 233',)]
[('MATH 135',), ('MATH 145',), ('STAT 220',), ('MATH 230',), ('MATH 240',)]
[('AMATH 250', 'MATH 237'), ('AMATH 250', 'MATH 247Level 3A')]
[('BIOL 140', 'BIOL 308'), ('BIOL 140', 'BIOL 330'), ('BIOL 140L', 'BIOL 308'), ('BIOL 140L', 'BIOL 330'), ('BIOL 208', 'BIOL 308'), ('BIOL 208', 'BIOL 330'), ('BIOL 330', 'BIOL 308'), ('BIOL 330', 'BIOL 330')]
[('CS 240',), ('SE 240',), ('CS 246',), ('ECE 222',)]
[('CS 246',), ('SE 240',), ('CS 240',)]
[('AMATH 341', 'MATH 128'), ('AMATH 341', 'MATH 138'), ('AMATH 341', 'MATH 148'), ('CM 271', 'MATH 128'), ('CM 271', 'MATH 138'), ('CM 271', 'MATH 148'), ('CS 371', 'MATH 128'), ('CS 371', 'MATH 138'), ('CS 371', 'MATH 148'), ('CS 370', 'MATH 128'), ('CS 370', 'MATH 138'), ('CS 370', 'MATH 148')]
[('MATH 135',), ('MATH 145',), ('STAT 220',), ('MATH 230',), ('MATH 240',)]
[('AMATH 250', 'MATH 237')]
[('BIOL 140', 'BIOL 308'), ('BIOL 140', 'BIOL 330'), ('BIOL 208', 'BIOL 308'), ('BIOL 208', 'BIOL 330'), ('BIOL 330', 'BIOL 308'), ('BIOL 330', 'BIOL 330')]
[('MATH 229', 'CO 227'), ('MATH 229', 'CO 250'), ('MATH 229', 'CO 350'), ('MATH 229', 'CO 355'), ('MATH 229', 'CO 352'), ('MATH 229', 'CM 340'), ('MATH 239', 'CO 227'), ('MATH 239', 'CO 250'), ('MATH 239', 'CO 350'), ('MATH 239', 'CO 355'), ('MATH 239', 'CO 352'), ('MATH 239', 'CM 340'), ('MATH 249', 'CO 227'), ('MATH 249', 'CO 250'), ('MATH 249', 'CO 350'), ('MATH 249', 'CO 355'), ('MATH 249', 'CO 352'), ('MATH 249', 'CM 340')]
[('CS 240',), ('SE 240',), ('CS 246',), ('ECE 222',)]
[('CS 241', 'STAT 206'), ('CS 241', 'STAT 230'), ('CS 241', 'STAT 240')]
>>>