On Fri, 10 Dec 2010, Alan Gauld wrote:
"Ben Ganzfried" wrote
n = s.find('not')
b = s.find('bad')
if n != -1 and b != -1 and b > n:
s = s[:n] + 'good' + s[b+3:]
return s
It's clear that n!=-1 and b!=-1 means something like : "if in the
string 's' we find the word "not" and in string 's
"Ben Ganzfried" wrote
n = s.find('not')
b = s.find('bad')
if n != -1 and b != -1 and b > n:
s = s[:n] + 'good' + s[b+3:]
return s
It's clear that n!=-1 and b!=-1 means something like : "if in the
string 's' we find the word "not" and in string 's' we find the word
"bad."
Exactly the o
I'm currently working through the Google Python tutorial exercises and
had questions about the following function:
def not_bad(s):
# +++your code here+++
# LAB(begin solution)
n = s.find('not')
b = s.find('bad')
if n != -1 and b != -1 and b > n:
s = s[:n] + 'good' + s[b+3:]
return