-5

Say we have a string

"SS in a dark room"
True

I want to check if this string contains 2 or more 'S' characters next to each other, so here it would be True but in this string it would be False:

"ss in a dark room"
False

Here it would be False:

"S in a dark room" 
False

and here it would be True

"SSS in me"
True
1
  • 5
    It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on their own. Commented Mar 12, 2016 at 18:43

1 Answer 1

13

Can't you just do:

the_string = "SS in a dark room"
print("SS" in the_string)
## Returns True
Sign up to request clarification or add additional context in comments.

1 Comment

Use python3's syntax print()

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.