1

how do you check if a string has more than one specific character in python. Example The string, 'mood' would clearly have two 'o' characters

0

1 Answer 1

3

You can use the str.count method:

>>> 'mood'.count('o') > 1
True
>>>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.