class Set: def __init__(self, my_list={}): self.my_list = my_list print(my_list)
How can I implement a class that when a=Set ([1,2,3,1]) comes out as {1,2,3} and is deduplicated?
class Set: def __init__(self, my_list:list): a = [] for i in my_list: if i not in a: a.append(i) self.my_list = a print(self.my_list)
841 /usr/bin/google-chrome:symbol lookup error:/usr/bin/google-chrome: undefined symbol:gbm_bo_get_modifier
588 Uncaught (inpromise) Error on Electron: An object could not be cloned
563 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
1008 In Java servlet, when SHA-256 sends WW-Authenticate header for digest authentication, the client does not return the result.
563 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.