0

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.append(str(i))
    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?

2
  • 2
    append is used for lists. You can concatenate strings using +. Commented Nov 27, 2016 at 14:09
  • This snippet has no sense. I vote to delete this question because is confusing people. Commented Nov 27, 2016 at 14:14

1 Answer 1

1

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

seed += str(i)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.