An empty tuple is a tuple containing no elements. In Python, write it as (). Tuples can hold sequences of objects, and an empty tuple gives you a clear starting value for a collection that will grow as the program finds results. section 10.1 section 19.2
Starting a word collection
In the Scrabble program, all_valid_words = () and found_words = () create two empty tuples. The program later adds each discovered word by concatenating a one-item tuple, such as (word,), to the existing tuple. section 19.2
Listing 19.1. Scrabble: Art Edition code for initializations
words = """art #1 hue ink ... crosshatching """ tiles = "hijklmnop" all_valid_words = () #2 start = 0 #3 end = 0 #4 found_words = () #5
See the initialization listing where empty tuples establish the starting collections for valid words and found words. section 19.2
Keep these tuple forms distinct:
- () contains no objects, while (word,) contains one object. The comma identifies a singleton tuple. section 10.1
- Use parentheses and commas to represent tuples containing different kinds of objects, including nested tuples. section 10.1






