-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
Karatawi
  • 378
  • 2
  • 6
  • 16
  • 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. – vaultah Mar 12 '16 at 18:43

1 Answers1

13

Can't you just do:

the_string = "SS in a dark room"
print("SS" in the_string)
## Returns True
Jurakin
  • 832
  • 1
  • 5
  • 19
Julien Spronck
  • 15,069
  • 4
  • 47
  • 55