Skip to content

Instantly share code, notes, and snippets.

View sammoorhouse's full-sized avatar

Sam Moorhouse sammoorhouse

View GitHub Profile
people = {
"sam": 1984,
# ...
}
def getAge(dob):
return 2019 - dob
ages = [getAge(dob)
for name, dob in people.items()
people = {
"sam": 1984,
"david": 1990,
"stephanie": 1992,
"helen": 1986,
"kate": 1987
}
#list of the ages of everyone older than 30
print("hello")
a = [1, 15, 94, 13, 12, 11, 5, 22, 65]
b = 3 * 2
def printNums():
for n in range(9):
if n > 5:
print(a[n] + b)
print("hello")
a = [1, 15, 94, 13, 12, 11, 5, 22, 65]
b = 3 * 2
def printNums():
for n in range(9):
print(a[n] + b)
printNums()
print("hello")
a = [1, 15, 94, 13, 12, 11, 5, 22, 65]
b = 3 * 2
for n in range(9):
print(a[n] + b)
for n in range(9):
print(a[n] + b)
print("hello")
a = [1, 15, 94, 13, 12, 11, 5, 22, 65]
b = 3 * 2
for n in range(9):
print(a[n] + b)
print ("goodbye")
print("hello")
a = [1, 15, 94, 13, 12, 11, 5, 22, 65]
b = 3 * 2
if b > 3:
print (a[b])
else:
print("too small")
print ("goodbye")
print("hello")
a = [1, 15, 94, 13, 12, 11, 5, 22, 65]
b = 3 * 2
print (a[b])
print ("goodbye")
@sammoorhouse
sammoorhouse / index.html
Last active October 16, 2017 12:00
Circular percentage control
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3: Pie layout</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200' rel='stylesheet' type='text/css'>
<style type="text/css">
text {
import pyowm
owm = pyowm.OWM('{API-KEY}')
observation = owm.weather_at_place('London,uk')
w = observation.get_weather()
w.get_wind()
w.get_humidity()