You are on page 1of 2

integers={}

for i in s:

if i in integers:

integers[i] += 1

else:

integers[i] = 1

print (str(integers))

list(integers.values())

x1,y1=firstCorner[0],firstCorner[1]

x2,y2=secondCorner[0],secondCorner[1]

for i in range(len(pointList)):

x = pointList[i][0]

y = pointList[i][1]

if not ((x >= x1 and x <= x2) and (y >= y1 and y <= y2)):

return False

if not ((x <= x1 and x >= x2) and (y <= y1 and y >= y2)):

return False

return True

print(allIn((0,0),(5,5),[(1,1),(0,0),(5,5)]))

print(allIn((0,0),(5,5),[(1,1),(0,0),(5,6)]))
print(allIn((0,0), (5,5), []))

print(allIn((1,1),(6,6),[(2,2),(0,0),(5,5)]))

print(allIn((3,4),(8,9),[(4,5),(6,7),(9,5)]))

def all_In(firstCorner=(0,0), secondCorner=(0,0), pointList=[]):

return bool(pointList)

x1,y1=firstCorner[0],firstCorner[1]

x2,y2=secondCorner[0],secondCorner[1]

for i in range(len(pointList)):

x = pointList[i][0]

y = pointList[i][1]

if all(x >= x1 and x <= x2 and y >= y1 and y <= y2):

return True

elif all(x <= x1 and x >= x2 and y <= y1 and y >= y2):

return False

else:

return True

You might also like