How to find largest number in file and see on which line it is
<p>The file looks like this:</p>

<pre><code>1, a b
2, c d
3, e f
</code></pre>

<p>my current code </p>

<pre><code>b = open('file.txt', 'r')

c = b.readlines()
regels = len(c)

print(regels)
</code></pre>

<p>I got the numbers of lines but still need biggest number + on which line it is. </p>

<p>So you are just looking to find the biggest number in the first column of the file? This should help</p>

<pre><code>b = open('file.txt', 'r')

c = b.readlines()
regels = len(c)

print(regels)

max = 0
for line in b.readlines():
  num = int(line.split(",")[0])
  if (max &lt; num):
    max = num 


print(max)
# Close file
b.close()
</code></pre>

python