Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Create multi-element and single-element tuples
server_config = ("192.168.1.1", 8080, "HTTPS")
empty_tuple = ()
# Notice the trailing comma required for single-element tuples!
single_item_tuple = ("production",)
print("Config:", server_config)
print("Empty tuple:", empty_tuple)
print("Single-item tuple:", single_item_tuple)
print("Type of single-item:", type(single_item_tuple).__name__)