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

Perhaps you mean

>>> len('string')
6
Jump to Post

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.