In [11]:
b = 1
for i in range(5):
    print b
    b += 1


1
2
3
4
5

In [9]:
for i in range(5):
    b = 5
    print b
    b += 1


5
5
5
5
5

In [13]:
for i in range(10):
    print i
    for j in range(10):
        print j
print i


0
0
1
2
3
4
5
6
7
8
9
1
0
1
2
3
4
5
6
7
8
9
2
0
1
2
3
4
5
6
7
8
9
3
0
1
2
3
4
5
6
7
8
9
4
0
1
2
3
4
5
6
7
8
9
5
0
1
2
3
4
5
6
7
8
9
6
0
1
2
3
4
5
6
7
8
9
7
0
1
2
3
4
5
6
7
8
9
8
0
1
2
3
4
5
6
7
8
9
9
0
1
2
3
4
5
6
7
8
9
9

In [14]:
person= raw_input("Enter your name: ")


Enter your name: Richard

In [15]:
person


Out[15]:
'Richard'

In [16]:
3/4


Out[16]:
0

In [17]:
3/4.0


Out[17]:
0.75

In [24]:
import csv

In [27]:
inputFile = open('../lede_algorithms/class1_1/exercise/excuse.csv','rU')
inputReader = csv.reader(inputFile)

In [28]:
for line in inputFile:
    line = line.split(',')
    print line


['excuse', 'headline', 'hyperlink\rthe fog was unexpected and did slow us down a bit', "De Blasio Blames 'Rough Night' and Fog for Missing Flight 587 Ceremony", 'http://www.dnainfo.com/new-york/20141112/rockaway-park/de-blasio-arrives-20-minutes-late-flight-587-memorial-angering-families\rwe had some meetings at Gracie Mansion', "De Blasio 30 Minutes Late to Rockaway St. Patrick's Day Parade", 'http://www.dnainfo.com/new-york/20150307/belle-harbor/de-blasio-30-minutes-late-rockaway-st-patricks-day-parade\rI had a very rough night and woke up sluggish', "De Blasio Blames 'Rough Night' and Fog for Missing Flight 587 Ceremony", 'http://www.dnainfo.com/new-york/20141112/rockaway-park/de-blasio-arrives-20-minutes-late-flight-587-memorial-angering-families\rI just woke up in the middle of the night and couldn\x89\xdb\xaat get back to sleep', "De Blasio Blames 'Rough Night' and Fog for Missing Flight 587 Ceremony", 'http://www.dnainfo.com/new-york/20141112/rockaway-park/de-blasio-arrives-20-minutes-late-flight-587-memorial-angering-families\rwe had some stuff we had to do', "De Blasio 30 Minutes Late to Rockaway St. Patrick's Day Parade", 'http://www.dnainfo.com/new-york/20150307/belle-harbor/de-blasio-30-minutes-late-rockaway-st-patricks-day-parade\rI should have gotten myself moving quicker', "De Blasio Blames 'Rough Night' and Fog for Missing Flight 587 Ceremony", 'http://www.dnainfo.com/new-york/20141112/rockaway-park/de-blasio-arrives-20-minutes-late-flight-587-memorial-angering-families\rI was just not feeling well this morning', "De Blasio Blames 'Rough Night' and Fog for Missing Flight 587 Ceremony", 'http://www.dnainfo.com/new-york/20141112/rockaway-park/de-blasio-arrives-20-minutes-late-flight-587-memorial-angering-families\rbreakfast began a little later than expected', '"De Blasio 15 Minutes Late to St. Patrick\'s Day Mass', ' Blames Breakfast"', 'http://www.dnainfo.com/new-york/20150317/midtown/de-blasio-15-minutes-late-st-patricks-day-mass-blames-breakfast\rthe detail drove away when we went into the subway rather than waiting to confirm we got on a train', 'Mayor de Blasio Is Irked by a Subway Delay', 'http://www.nytimes.com/2015/05/06/nyregion/mayor-de-blasio-is-irked-by-a-subway-delay.html?ref=nyregion&_r=0\rwe waited 20 mins for an express only to hear there were major delays', 'Mayor de Blasio Is Irked by a Subway Delay', 'http://www.nytimes.com/2015/05/06/nyregion/mayor-de-blasio-is-irked-by-a-subway-delay.html?ref=nyregion&_r=0\rwe need a better system', 'Mayor de Blasio Is Irked by a Subway Delay', 'http://www.nytimes.com/2015/05/06/nyregion/mayor-de-blasio-is-irked-by-a-subway-delay.html?ref=nyregion&_r=0']

In [ ]:
inputFile = open('/Users/richarddunks/Dropbox/Datapolitan/Projects/Training/)