fork download
  1. '''
  2. write a function that has two string parameters s1 and s2, and returns
  3. true if if s1 contains s2
  4. '''
  5. s1 = 'rainbow'
  6. s2 = 'bow'
  7. expected = True
  8.  
  9. def contains(s1, s2):
  10. # write your code here
  11. result = s2 in s1
  12. return result
  13.  
  14. actual = contains(s1, s2)
  15. print(actual == expected)
Success #stdin #stdout 0.03s 9668KB
stdin
1
2
10
42
11
stdout
True