Tag:get home

  • Python 3 dictionary merge

    Time:2021-11-17

    Method 1: >>> a = {“a”: “a”, “b”: “b”} >>> b = {“b”: “b”, “c”: “c”} >>> {**a, **b} {‘a’: ‘a’, ‘b’: ‘b’, ‘c’: ‘c’} Method 2: >>> a = {“a”: “a”, “b”: “b”} >>> b = {“b”: “b”, “c”: “c”} >>> dict(a, **b) {‘a’: ‘a’, ‘b’: ‘b’, ‘c’: ‘c’} Method 3: >>> a = […]

  • Thread communication

    Time:2020-6-20

    How threads communicate In order to realize the coordination between threads, such as: the execution sequence of threads, obtaining the execution result of a thread, etc., the mutual communication between threads is involved, which is divided into the following four categories File sharing Network sharing Variable sharing The thread coordination API provided by JDK is […]

  • C × do… While loop

    Time:2019-12-16

    I. Introduction The loop in for and while writes test loop conditions at the head, while the loop in do…. while writes test conditions at the end of the loop The loop of do… While is similar to that of while, but the loop body of do… While is executed at least once. Two. Grammar […]