[Python] Is there a way to increase numeric value in a string variable? [Python]

Discussão em 'Python' iniciado por Stack, Dezembro 1, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying some web-scraping which requires to loop through some elements having attribute in a string format. But the string is a numeric value which increases throughout the element.

    data_id="1"


    Is there a way to increase the value of data-id to "2" to "3" so on while it remains in string format?

    Continue reading...

Compartilhe esta Página