Sign in
Log inSign up

Can someone explain ?

Umesh Kumar's photo
Umesh Kumar
·Jan 3, 2018
from itertools import permutations

word, num = input().split(" ")
permutations = list(permutations(word, int(num)))
permutations.sort()

[print("".join(i)) for i in permutations]

i don't understand the last line why the [ ] brackets.