123456789101112131415161718192021222324252627282930313233 |
- # Распаковка словаря с ключами и значениями
- def func_1():
- d1 = {'key1': 1, 'key2': 2}
- d2 = {'key2': 1, 'key3': 2}
- d3 = {'a1': 1, **d2, **d1}
- print(d3)
- def concatenate(**kwargs):
- ret = ""
- for x in kwargs.values():
- if (type(x) == list):
- ret += ''.join(str(x))
- else:
- ret += str(x)
- return ret
- def main():
- # func_1()
- print(concatenate(q='iHave', w="next", e="Coins", r=[10, 5, 10, 7]))
- # print(concatenate(q='iHave', w="next", e="Coins"))
- # l = [1, 2, 3]
- # foo = ''.join(str(l))
- # print(foo)
- if __name__ == '__main__':
- main()
|