Aug-26-2020, 05:54 AM
(This post was last modified: Aug-26-2020, 05:54 AM by twinstars2020.)
hello, i was trying a testdome python test but failed the 1st question despite getting the required answers. Any idea or advice why and how to improve my statements?
test is random and not a very big samples - available here Testdome URL for Python
def unique_names(names1, names2): return None if __name__ == "__main__": names1 = ["Ava", "Emma", "Olivia"] names2 = ["Olivia", "Sophia", "Emma"] joinednames = names1 + names2 # print(joinednames) output = set() for x in joinednames: output.add(x) print(output) # unique_names = set() # for x in joinednames: # joinednames.add(x) # print(unique_names(names1, names2)) # should print Ava, Emma, Olivia, Sophiamy results were {'Ava', 'Sophia', 'Emma', 'Olivia'}
test is random and not a very big samples - available here Testdome URL for Python