Question: Write a Python one - liner to generate a list, d , consisting of pairs in the format ( a , b ) where: a

Write a Python one-liner to generate a list, d, consisting of pairs in the format (a, b) where:
a =2j +1
b =100 j
where j ranges from 1 to 10.
Utilize the list d to generate a list s with a single line of Python code according to the following and then print s:
s = a \times b if b is even, otherwise a + b
Exclude pairs from d where b is divisible by 3.

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 Programming Questions!