Question: write the following code in python 3.2+. Recursive function prefered. Thank you! Define a function named q3() that accepts a List of characters as a

 write the following code in python 3.2+. Recursive function prefered. Thank

write the following code in python 3.2+. Recursive function prefered. Thank you!

Define a function named q3() that accepts a List of characters as a parameter and returns a Dictionary. The Dictionary values will be determined by counting the unique 3 letter combinations created by combining the values at index 0, 1, 2 in the List, then the values at index 1, 2, 3 and so on. The q3() function should continue analyzing each sequential 3 letter combination and using them to create the key and value combinations in a Database, incrementing the value to indicate the number of times a sequence occurs. In the following example, the sequence 'ABA' occurs twice, while the sequences 'BAB' and 'BAA' each occur only once. So, given the List ['A', 'B', 'A', 'B', 'A', 'A'] the q3() function would return the Dictionary {'ABA': 2, 'BAB': 1, 'BAA': 1} Example

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!