[Python] creating a non-literal python tuple programmatically

Discussão em 'Python' iniciado por Stack, Julho 25, 2025.

  1. Stack

    Stack Membro Participativo

    I want to create a tuple of length m, with a 1 in each position except for one n in position k.

    e.g.: m=5, n=7, k=3 should yield (1,1,1,7,1) (length 5 with a 7 in position 3)

    How can I do this?

    Continue reading...

Compartilhe esta Página