list comprehension

Run Settings
LanguagePython
Language Version
Run Command
list = [i*j for i in range(1, 4) for j in range(2, 5)] print(list) #the following function has the same results as line 1 for i in range(1, 3): #run i from range(1, 2), i = 1, i =2 for j in range(2, 4): #run j from range(2, 4), j = 2, 3 i * j #i*j =1*2 = 2, i*j = 1*3 = 3, i*j = 2*2 =4, i*j = 2*3=6 print(i*j)
Editor Settings
Theme
Key bindings
Full width
Lines