0

Why not print output?? I am very beginner in Python.

Why the below program not print Orange chair Orange book Orange laptop Black chair Black book Black laptop White chair White book White laptop l1 = ["orange","black","white"] l2 = ["chair","book","laptop"] for i in [l1]: for j in [l2]: print(i,j)

29th May 2020, 8:48 PM
Neeraj Sharma
Neeraj Sharma - avatar
3 Answers
+ 4
for i in l1: for j in l2: print(i,j) Don't put square brackets around list variable in for loop
29th May 2020, 8:50 PM
Abhay
Abhay - avatar
+ 2
No problem:-)
29th May 2020, 9:14 PM
Abhay
Abhay - avatar
0
thank you Abhay đŸ™đŸŒ
29th May 2020, 8:58 PM
Neeraj Sharma
Neeraj Sharma - avatar