Python Forum
hello, i was trying a testdome python test
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hello, i was trying a testdome python test
#1
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?
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, Sophia
my results were {'Ava', 'Sophia', 'Emma', 'Olivia'}
test is random and not a very big samples - available here Testdome URL for Python
Reply


Messages In This Thread
hello, i was trying a testdome python test - by twinstars2020 - Aug-26-2020, 05:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to test the high-score in my Python-game Pluviometer 2 584 Oct-02-2023, 06:55 PM
Last Post: deanhystad
  How to test and import a model form computer to test accuracy using Sklearn library Anldra12 6 3,142 Jul-03-2021, 10:07 AM
Last Post: Anldra12
  cannot build python 3.8.2 (make test fails on test_imprtlib) borabora 1 2,764 May-08-2020, 09:10 PM
Last Post: Larz60+
  How to write test cases for a init function by Unit test in python? binhduonggttn 2 3,130 Feb-24-2020, 12:06 PM
Last Post: Larz60+
  How to write test cases by Unit test for database configuration file? binhduonggttn 0 2,566 Feb-18-2020, 08:03 AM
Last Post: binhduonggttn
  new python package test ramkrishna 0 1,871 Feb-25-2019, 12:18 PM
Last Post: ramkrishna
  Python test failed CodingMaster111 1 3,857 May-09-2018, 04:24 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020