'Merge one list with another using robotframework

I've got 2 lists and I want to merge first list with second in third list by next rule - zero element of third list = "zero element of first list AND zero element of second list". It's looks like "192.168.89.150 and 239.255.255.250" - this is the element of third list. This is my code:

    @{temp_list} =  Create List     ${empty}
FOR    ${index}     IN RANGE    0   ${length_ip_in}
${ip_api}=   set variable   "{ip_in}[${index}] and ${ip_out}[${index}]"
${ip_api}=  convert to list   ${ip_api}
${temp_list}   append to list  ${ip_api}
log to console    IP API: ${temp_list}
END

In out log i've got error: Evaluating expression 'None.append("192.168.89.150 and 239.255.255.250")' failed: AttributeError: 'NoneType' object has no attribute 'append'

Need help!



Solution 1:[1]

*** Settings ***
Library    Collections

*** Test Cases ***
Test_Megrge_List
    ${List1}=    Create List    1  2  3
    ${List2}=    Create List    4  5  6
    ${CombinedList}=    Combine Lists    ${List1}    ${List2}
    Log List    ${CombinedList}    level=INFO

If you want to combine two list , just use Combine Lists keyword. The above snippet combines two list

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Manish Kumar