dailylog 3-12-20
Things I did today!
- Woke up with the crazy kitties at 6:30
- Lazed in bed until 6:45
- Hopped on exercise bike until 7:15
- Showered until 7:20
- Ready by 7:30
- 750 Words “Dear Professor Fox I am not incompetent”
- ??
- Discovered old flask app
- Pushed flask app live here and did so using my old tutorial lololololol
- Decided to keep working on this flask app with titanic data
function makeDict(arr1, arr2){
// Make a dictionary
d1 = {}
d2 = {}
for (var i = 0; i < arr1.length; i++){
d1[arr1[i]] = 1
}
for (var i = 0; i < arr2.length; i++){
d2[arr2[i]] = 1
}
// Return dictionary
return [d1, d2]
}
result = makeDict([2,3,4,5], [6,7,8,9])
console.log(result)
function makeDict(arr1, arr2){
// Make a dictionary
d1 = {}
d2 = {}
for (let val of arr1){
d1[val] = (d1[val] || 0) + 1
}
for (let val of arr2){
d2[val] = (d2[val] || 0) + 1
}
// Return dictionary
return [d1, d2]
}
result = makeDict([2,3,4,5], [6,7,8,9,9,9])
console.log(result)