#!/usr/bin/env python3 from pyspark import SparkContext, SparkConf def make_plural(word): return word + "s" sc = SparkContext() animal_list = ['dog', 'cat', 'rabbit', 'hare', 'deer', 'gull', 'woodpecker', 'mole'] animal_rdd = sc.parallelize(animal_list, 2) plural_rdd = animal_rdd.map(make_plural) print(plural_rdd.collect())