Consider the following code segment: primes = {2, 3, 5, 7} odds = {1, 3, 5, 7} Which line of code will result in x containing {1}? a. x = primes.difference(odds) b. x = odds.difference(primes) c. x = primes.intersection(odds) d. x = odds.intersection(primes)

Answer :

Answer:

a. x = primes.difference(odds)

Step-by-step explanation:

Given the list of numbers primes and odds, the list x is made subtracting odds to primes. To do that in a object oriented language you use: x = primes.difference(odds) which is equivalent to x = primes  - odds

Other Questions