What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-29 05:56:05
iterate over a list python
list = [1, 3, 6, 9, 12] for i in list: print(i) Add solution -
Python 2021-09-21 23:05:02
permutations in python
# A Python program to print all permutations using library function from itertools import permutations perm = permutations([1, 2, 3]) for i in list(perm): print (i) # (1, 2, 3) # (1, 3, 2) # (2, 1, 3) # (2, 3, 1) # (3, 1, 2) # (3, 2, 1) Add solution -
Python 2021-09-12 00:29:02
pyhton permutations
# A Python program to print all permutations using library function from itertools import permutations perm = permutations([1, 2, 3]) for i in list(perm): print (i) # (1, 2, 3) # (1, 3, 2) # (2, 1, 3) # (2, 3, 1) # (3, 1, 2) # (3, 2, 1) Add solution -
Python 2021-08-27 23:00:02
python nested loop for a 2D list
list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] for i in range(0, len(list)): # loops over the external list for j in range(0, len(list[i])): # loops over every internal list print(list[i][j], end="\t") # prints the elements of the inner l... Add solution