def generate_version(parts):
    """Generate a version number string from the specified parts"""

    version = '.'.join([str(part) for part in parts[0:2]])
    if len(parts) > 3:
        version += parts[3]
        if len(parts) > 4:
            version += str(parts[4])
    return version