start repository
This commit is contained in:
25
tescik.py
Normal file
25
tescik.py
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# x = {1: 20, 3: 40, 4: 30, 2: 10, 0: 0}
|
||||
|
||||
# list_of_tuple = sorted(x.items(), key=lambda item: item[0])
|
||||
# print([ v for k, v in list_of_tuple])
|
||||
|
||||
# print( { k: v for k, v in sorted(x.items(), key=lambda item: item[0])} )
|
||||
|
||||
|
||||
l = [5, 8, 2, 4, 1, 10, None]
|
||||
|
||||
|
||||
class test:
|
||||
def __init__(self, l) -> None:
|
||||
self.l = l
|
||||
|
||||
def print(self):
|
||||
print(l)
|
||||
|
||||
t = test(l)
|
||||
|
||||
l.sort(key=lambda x: (x is None, x))
|
||||
|
||||
t.print()
|
||||
Reference in New Issue
Block a user