Enum lab questions?
It is a great vaccine. It is a safe vaccine, and it is something that works.
Chapter 9
If we allow C++, we can use a proper pass by reference mode.
Callers will be able to see modifications to mutable objects
Callers will still hold a reference to the exact same object
Immutable objects (such as tuples or strings) can’t be modified for the caller
Python allows us to annotate optional parameters by providing default values
All parameters are optional in Javascript
printf in Cimport urllib.request
import json
junk_foods = [
'Pizza',
'Popcorn',
'Hamburger',
'Pepsi',
'Potato_chip',
'Cake',
]
url = 'https://en.wikipedia.org/w/api.php?action=parse&format=json&page='
for food in junk_foods:
contents = urllib.request.urlopen(f'{url}{food}').read()
print(f"{food}: {json.loads(contents)['parse']['properties'][0]['*']}")const https = require('https')
junk_foods = ['Pizza', 'Popcorn', 'Hamburger', 'Pepsi', 'Potato_chip', 'Cake']
url = 'https://en.wikipedia.org/w/api.php?action=parse&format=json&page='
junk_foods.forEach(food => {
https.get(
{
host: 'en.wikipedia.org',
path: '/w/api.php?action=parse&format=json&page=' + food,
},
function (res) {
let body = ''
res.on('data', function (d) {
body += d
})
res.on('end', function () {
console.log(`${food}: ${JSON.parse(body).parse.properties[0]['*']}`)
})
},
)
})