array_XOR

Run Settings
LanguageJulia
Language Version
Run Command
#https://stackoverflow.com/questions/47985297/how-to-xor-two-lists-in-python/47985302 println("julia ver.: ", VERSION) a_list = ["hello", "world"] b_list = ["hello", "world", "1.one", "2.two"] c_list = String[] c_list = append!(c_list, a_list) c_list = append!(c_list, b_list) println("List a= ", a_list) println("List b= ", b_list) println("a + b = ", c_list) ans_list = String[] for item in c_list if !(item ∈ a_list) || !(item ∈ b_list) push!(ans_list, item) end end println("\nAns: ", ans_list)
Editor Settings
Theme
Key bindings
Full width
Lines