[Python] How to convert an integer to a list in python?

Discussão em 'Python' iniciado por Stack, Junho 15, 2025.

  1. Stack

    Stack Membro Participativo

    I have an integer object for example a = 1234 and I want to convert it to a list, so it would look something like [1234].

    I tried converting it into a string first and then converting it to a list but that gives me [1,2,3,4]. Any suggestions?

    Continue reading...

Compartilhe esta Página