Convert the following from a list comprehension to a noncomprehension i.e. regular Python code. Hint: Use 2 nested for loops

Convert the following from a list comprehension to a non-comprehension, i.e. regular Python code.
Hint: Use 2 nested for loops
x1 = [1,2]
x2 = [3,4]
print(B:, [(x, y) for x in x1 for y in x2])
Output:
B: [(1, 3), (1, 4), (2, 3), (2, 4)]

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions