# Tuesday October 24th

## Hello back from Chrome Dev!

• It was a fun time!

Here are some pics!

## Hosts

• You may remember Mariko from her Strange Loop talk “How to Be a compiler!”

## He was in a film haha! Left film to work in software

• Not too shabby.

• We voted on questions. Chris Wilson was the moderator. I really liked Chris’s talk; particularly when he mentiioned Ele.me

## Using Sketchup to Interact with real model with industrial applications

• I gave this guy at the booth an idea that he may pursue. He was really excited about it!

## After party

• The World’s Largest Pac-Man!

## Things going on

• I have SCNA on Friday
• I have a C++ midterm project I’m working on
• Finishing up my Nanodegree
• Have coding interview question to do (only 2 hours or so)

## Katas

• if you can fill an order based on stock, return true else return False. SKUs baby!
``````def fillable(stock, merch, n):
for key in stock:
if merch in stock:
if key == merch and stock[key] >= n:
return True
break;
elif key == merch and stock[key] < n:
return False
else:
return False
break;
return
``````
• find the distance travelled by an elevator (basically floor before minus floor above in abs value). This was interesting; you could either zip or use list comprehension for this
``````def elevator_distance(array):
# use list comprehension
arr = [array[i - 1] - array[i] for i in range(1, len(array))]
total = 0

for i in arr:
total = total + abs(i)
``````
• sum array of all elements that don’t have dupes
``````def repeats(arr):
arr1 = []
arr2 = []
total = 0
for i in arr:
if arr.count(i) == 2:
arr1.append(i)
else:
arr2.append(i)
for i in arr2:
total = total + i
``````
• check area code, match with region
``````def detect_operator(num):
code = (str(num)[1:4])
if (code == "039"):
return "Golden Telecom"
elif (code == "050") or (code == "066") or (code == "095"):
return "MTS"
elif (code == "063") or (code == "093"):
return "Life:)"
elif (code == "068"):
return "Beeline"
elif (code == "099"):
return "MTS"
elif (code == "067") or (code == "096") or (code == "097") or (code == "098"):
return "Kyivstar"
else:
return "no info"
return
``````
• this was unnecessary. Returning type but wasn’t passing. Unexpectedly, got it to pass tests.
``````def types(x):
try:
a = ((type(x)))
return a[8:-2]

except:
return x
``````
Written on October 24, 2017