Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Assemble string outputs from lists using join()
tokens = ["www", "python", "org"]
tags = ["backend", "python", "ai", "fastapi"]
# 1. Join domain tokens with dots '.'
domain = ".".join(tokens)
# 2. Join tags with hashtag prefix and space separator
hashtag_string = " ".join(["#" + tag for tag in tags])
print("Domain:", domain)
print("Hashtags:", hashtag_string)