Generation

generate functionTue, 13 Dec 2022

write a function that looks for x in y while z and p != o for when o < y

def look_for_x(y, z, p): count = 0 for o in y: if o == "x": count = count + 1 if (count == z): if (p != o): return True else: return False look_for_x("xoxooxx", 2, "o")

Questions about programming?Chat with your personal AI assistant