title: convert string into seconds using ctime
body: <p>I have to write a function that converts a string in the format H:MM:S into seconds using time.ctime( and convert it back to clock. How can I do this in python?</p>
  
  <p>For example:</p>
  
  <p>"123:00" would produce an output of 7380</p>
  
  <p>"0:01" would produce an output of 1</p>
  
  <p>"0:00:00" would produce an output of 0</p>
  
  <p>i have started with this code</p>
  
  <pre><code>def convert_to_seconds(time_as_a_string):
      time = []
      start = 0
      seconds = time.ctime(seconds)
      if seconds &gt;0:
  </code></pre>