Question
Write a SNAP function that takes a list of mixed words and numbers and selects just the words and appends a number index in front
Write a SNAP function that takes a list of mixed words and numbers and selects just the words and appends a number index in front of the word.
For instance, if the input list is given as
Today is March 22 Wednesday day 3 of the week
The output will be:
1Today 2is 3March 4Wednesday 5day 6of 7the 8week
You are not allowed to use iteration blocks such as for or repeat but you can everything else.
Hint: you can define a global variable called index and implement a function that inserts the index in the front of the word and use this function as input to your map block.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started