1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Why does translate replace symbols with symbols codes?

Discussão em 'Python' iniciado por Stack, Setembro 12, 2025.

  1. Stack

    Stack Membro Participativo

    Why does translate replace symbols with word codes

    In this example, I get numeric symbol codes in the translation table, not the symbols themselves. Why? And how can I make a translation table with symbols based on variables?

    str_1 = 'abcd'
    str_2 = 'dcba'
    tbl_trans = str.maketrans(str_1, str_2)
    print(tbl_trans)

    Continue reading...

Compartilhe esta Página