How would I find the amount of characters in a string and then use that to print a certain amount of some character that you choose. For example:

a = 'string' # this holds 6 characters
print '*' * # amount of characters in string

Recommended Answers

All 2 Replies

Perhaps you mean

>>> len('string')
6

Thanks I have not been doing much work with strings latley I feel stupid now. Thanks for helping me though

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.