Question: Write a recursive function areSimilar(item1, item2) that returns True or False depending on whether or not the two given input items are similar according to
Write a recursive function areSimilar(item1, item2) that returns True or False depending on whether or not the two given input items are similar according to the following definition.
Two items are similar if:
1. they are the same type or both are numbers (i.e. float or int type)
2. if they are lists, they are of the same length and each pair of corresponding list items (i.e. items with the same index) is similar.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
