Question: 2. What does the following Python program do? #1 /usr/bin/python$ def shark( dog, cat): goose = dog + cat cow [] for x in goose:
2. What does the following Python program do? #1 /usr/bin/python$ def shark( dog, cat): goose = dog + cat cow [] for x in goose: if x in cat and x not in dog: cow.append (x) if x not in cat and x in dog: cow.append(x) duck [] for i in range(len (cow)): if cow[i] not in cow[o i]: duck.append (cowli]) return duck def main() dog = input ( ') cat = input('> ') duck = shark ( dog, cat ) print( ".join(duck) main)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
