|
@@ -23,6 +23,22 @@ def print_goods(lst):
|
|
|
pass
|
|
|
|
|
|
|
|
|
+def count_strings(*args):
|
|
|
+ str_count = 0
|
|
|
+ for value in args:
|
|
|
+ if isinstance(value, str):
|
|
|
+ str_count += 1
|
|
|
+ return str_count
|
|
|
+
|
|
|
+
|
|
|
+def find_keys(**kwargs):
|
|
|
+ lst = []
|
|
|
+ for name, value in kwargs.items():
|
|
|
+ if isinstance(value, (list, tuple)):
|
|
|
+ lst.append(name)
|
|
|
+
|
|
|
+ return sorted(lst, key=str.lower)
|
|
|
+
|
|
|
|
|
|
def main():
|
|
|
|
|
@@ -34,8 +50,13 @@ def main():
|
|
|
|
|
|
# print(check_exist_attrs(print_goods, ['is_working', 'status', 'time', 'speed']))
|
|
|
|
|
|
- create_attrs(print_goods, [('is_working', False), ('days', 10), ('status', 'Not ready')])
|
|
|
- print(check_exist_attrs(print_goods, ['sort', 'is_working', 'days', 'status', 'upper']))
|
|
|
+ # create_attrs(print_goods, [('is_working', False), ('days', 10), ('status', 'Not ready')])
|
|
|
+ # print(check_exist_attrs(print_goods, ['sort', 'is_working', 'days', 'status', 'upper']))
|
|
|
+
|
|
|
+ # print(count_strings(1, 2, 'hello', True, 't'))
|
|
|
+
|
|
|
+ print(find_keys(At=[4], awaited=(3,), aDobe=[5]))
|
|
|
+
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|