<jupyter_start><jupyter_text>Kissipo-Python-Asterisk在Python 星號(*)有很多不同作用參考: https://stackoverflow.com/questions/21809112/what-does-tuple-and-dict-mean-in-python  * in a function call*t means "treat the elements of this iterable as positional arguments to this function call."<jupyter_code>def foo(x, y):
    print(x+y)
t = [1, 2]
foo(*t)<jupyter_output><empty_output><jupyter_text>**in a function call**d means "treat the key-value pairs in the dictionary as additional named arguments to this function call."<jupyter_code>d = {'x':4, 'y':5}
foo(*d)
foo(**d)<jupyter_output><empty_output><jupyter_text>In a function definition*t means "take all additional positional arguments to this function and pack them into this parameter as a tuple."<jupyter_code>def goo(*t):
    print(t)
goo(1, 2)<jupyter_output><empty_output><jupyter_text>**d means "take all additional named arguments to this function and insert them into this parameter as dictionary entries."<jupyter_code>d = {'x':1, 'y':2}
goo(*d)
def hoo(x, y):
    print(x, y**2)

d = {'x':1, 'y':2}
hoo(**d)<jupyter_output><empty_output><jupyter_text>In assignments and for loops<jupyter_code>x, *xs = (1, 2, 3, 4)
print(xs)<jupyter_output><empty_output><jupyter_text>Unpacking using *<jupyter_code>a, *b = [2 * i + 1 for i in range(3)]
print(a)
print(b)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1437125748502994, 'fraction_numerical': 0.019461077844311378, 'mean_word_length': 6.818713450292398, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '540155', 'license': 'Apache-2.0', 'n_tokens_mistral': 530, 'n_tokens_neox': 506, 'n_words': 128, 'path': 'Kissipo_Python_Asterisk.ipynb', 'repo_name': 'htchu/KissipoPython', 'size': '1336'}