i=5 while i > 0: код ElemMail.send_keys(i) код i -= 1 # сдвигаем значение на 1 

How do i assign a string to i , i.e., to get, for example, 5_foo , on the next pass of the cycle 4_foo , 3_foo , etc.

I tried i=str(i+'_foo') - got an error:

TypeError: unsupported operand type (s) for - =: 'str' and 'int'

    1 answer 1

    Type conversion int -> str must be performed before string concatenation operation ( str + str )

     i=5 while i > 0: код ElemMail.send_keys(str(i) + '_foo') код i -= 1 # сдвигаем значение на 1 
    • Just did so and saw your comment)) Thanks for the reply! - Mike