954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to find the amount of characters in a string?

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
inuasha
Newbie Poster
22 posts since Dec 2011
Reputation Points: 10
Solved Threads: 3
 

Perhaps you mean

>>> len('string')
6
Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

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

inuasha
Newbie Poster
22 posts since Dec 2011
Reputation Points: 10
Solved Threads: 3
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: