fork download
  1. # import csv
  2. # with open('numbers.csv', 'r+') as csvfile:
  3. # numreader = csv.reader(csvfile)
  4.  
  5. # instead of actually reading from a file, let's just define it locally
  6. # but you see my point about being careful about where your stuff comes from?
  7.  
  8. numreader = [
  9. [1.0, 2.0, 1.5, 1],
  10. [3.5, 2.7, 4.8, 5]
  11. ]
  12. for row in numreader:
  13. for number in row:
  14. print(1 / number)
Success #stdin #stdout 0s 23296KB
stdin
Standard input is empty
stdout
1.0
0.5
0.666666666667
1
0.285714285714
0.37037037037
0.208333333333
0