entremanure entremanure - 1 year ago 90
Python Question

Python: Adding characters to strings error

I am creating a pseudo random encryption program, and IDLE returns and error when I try to expand my seed value. The code goes like this.

for i in str(addon):
seed = str(seed)
seed = int(seed)

When I run it, this happens.

AttributeError: 'str' object has no attribute 'append'

Any ideas on how I can add characters onto the end of a string?

Answer Source

Use + instead of append. Append is for list objects.

seed += str(i)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download