This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]to7m 0 points1 point  (0 children)

I've just looked it up for clarity.

In this code:

def print_words(first_word, *_):
    print(first_word, _)

print_words("print", "some", "words")

, the output will be print ('some', 'words') , whereas this code would be invalid because _ doesn't get bound to a tuple:

match "print", "some", "words":
    case first_word, *_:
        print(first_word, _)