<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def Version():
 """Gets the version of gdb as a 3-tuple. The gdb devs seem to think it's a good idea to make --version output multiple lines of welcome text instead of just the actual version, so we ignore everything it outputs after the first line. Returns: The installed version of gdb in the form (<major>, <minor or None>, <micro or None>) gdb 7.7 would hence show up as version (7,7) """

    output = subprocess.check_output(['gdb', '--version']).split('\n')[0]
    # Example output (Arch linux):
    # GNU gdb (GDB) 7.7
    # Example output (Debian sid):
    # GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1)
    # Example output (Debian wheezy):
    # GNU gdb (GDB) 7.4.1-debian
    # Example output (centos 2.6.32):
    # GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)

    # As we've seen in the examples above, versions may be named very liberally
    # So we assume every part of that string may be the "real" version string
    # and try to parse them all. This too isn't perfect (later strings will
    # overwrite information gathered from previous ones), but it should be
    # flexible enough for everything out there.
    major = None
    minor = None
    micro = None
    for potential_versionstring in output.split():
      version = re.split('[^0-9]', potential_versionstring)
      try:
        major = int(version[0])
      except (IndexError, ValueError):
        pass
      try:
        minor = int(version[1])
      except (IndexError, ValueError):
        pass
      try:
        micro = int(version[2])
      except (IndexError, ValueError):
        pass
    return (major, minor, micro)