Complete the code to create an accumulator variable named 'acc'.
acc = sc.[1](0)
The accumulator method creates an accumulator variable in Spark.
Complete the code to add 1 to the accumulator variable 'acc' inside the map function.
rdd.map(lambda x: (acc.[1](1), x))
The add method increments the accumulator by the given value.
Fix the error in the code to correctly get the accumulator's value.
print('Accumulator value:', acc.[1])
value() as a method.getValue().The accumulator's current value is accessed using the value property without parentheses.
Fill both blanks to create an accumulator and add 5 to it.
acc = sc.[1](0) acc.[2](5)
First, create the accumulator with accumulator. Then add 5 using add.
Fill all three blanks to create an accumulator, add 3 inside a map, and print its value.
acc = sc.[1](0) rdd.map(lambda x: acc.[2](3)) print(acc.[3])
Create the accumulator with accumulator, add 3 with add, and get the value with value.
