Question: let the variable : characters = [4, '', 8, '/', 7, 1, '$', 0, '', 7, 3, '!', 4] Write a python function that takes

let the variable : characters = [4, '', 8, '/', 7, 1, '$', 0, '', 7, 3, '!', 4]

Write a python function that takes a list as input, that your code will compare with the global variable character. If the list is a subset of the global variable, it returns the uncommon elements between both lists. If the list is not a subset it returns False.

You are not allowed to use set(), lambda, all.. . Keep it simple.

Example:

>>> compare([8, '', 4, '/', 7])

[1, '$', 0, '', 7, 3, '!', 4]

>>> compare([1, '$', 0, 1])

False

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!