Do I have to buy it again?
A:
You bought the PDF version. That should have been shipped with the book, but as far as I know, you never received it.
The PDF version is missing one chapter:
Anatomy of the Guitar
The guy who taught me the basics of the guitar was a guitarist himself, and he showed me the tuning diagrams for EADGBe. I was impressed, so I started practicing on the neck with the chord tabs.
But you can download the PDF for free from Lulu, or from the for-pay version.
Q:
Splitting an array of Strings and returning a list of the indices
I am trying to get the indices of the values that match the splitter array and return that. How do I go about this?
For example:
the array of strings is:
["Canon camera", "Canon DSLR camera", "Epson projector"]
and the splitter array is:
["camera", "dslr", "projector"]
I need a list of the 3 values that the splitter matches:
["0", "2", "3"]
I have a function that looks like this:
def splitter(filtered, splitter):
s = 0
for i in filtered:
for j in splitter:
if i.split(splitter) == splitter:
s = s + 1
return s
but it doesn't return anything, and I can't figure out why. What am I doing wrong here?
For your specific example, the code in splitter is never executed.
You can use the zip function to get the two lists together.
def splitter(filtered, splitter):
s = 0
for f, s in zip(filtered, splitter):
if f.split(splitter) == splitter:
Related links:
Comentarios