title: Take variable result and decrement by 1 in python
body: <p>This has got to be a real easy question and answer.  I have a dictionary key where the first usable IP address will always be the data.  I want to change it to the network IP so I just need to subtract 1 from the number.  Tried creating variable out of it that I can work with but I can't do math with strings.  Bonus points if I can decrement the IP without splitting it.  Can anyone point me int he right direction?</p>
  <pre class="lang-py prettyprint-override"><code>import csv
  
  minus_one = []
  
  with open('iplist.csv', mode='r') as csv_file:
      csv_reader = csv.DictReader(csv_file)
      line_count = 0
      for row in csv_reader:
  
          ip = row[&quot;IP_ADDRESS_ZLOC&quot;]
          split_ip = row[&quot;IP_ADDRESS_ZLOC&quot;].split(&quot;.&quot;)
          print(ip)
          print(split_ip)
          print('\n')
  
          if &quot;172&quot; in row[&quot;IP_ADDRESS_ZLOC&quot;].split(&quot;.&quot;)[0]:
  
              minus_one.append(
                  f'{row[&quot;IP_ADDRESS_ZLOC&quot;]} MINUS ONE???'
              )
  
  print('\n'.join(minus_one))
  </code></pre>
  <p>output:</p>
  <pre><code>172.22.11.22
  ['172', '22', '11', '22']
  
  
  172.22.11.33
  ['172', '22', '11', '33']
  
  
  10.10.10.11
  ['10', '10', '10', '11']
  
  
  172.22.11.22
  ['172', '22', '11', '22']
  
  
  172.22.11.22 MINUS ONE???
  172.22.11.33 MINUS ONE???
  172.22.11.22 MINUS ONE???
  </code></pre>