How do I insert a list at the front of another list?

Apply slicing:

a[0:0] = k

Or do it manually:

a = k + a

The first approach remain the same for insertion at any place, i.e. a[n:n] = k
would insert k at position n, but the second approach would not be the same, that will be

a = a[:n] + k + a[n:]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)