sc = SparkContext(appName="DistinctWordCount")
print(f"Unique words: unique_word_count") spark 2 workbook answers
## 7. Putting It All Together – A Mini‑Project Blueprint spark 2 workbook answers
### 🎯 Your Next Step
words = lines.flatMap(lambda line: line.split()) # optional cleaning cleaned = words.map(lambda w: w.lower().strip('.,!?"\'')) distinct_words = cleaned.distinct() count = distinct_words.count() spark 2 workbook answers