Skip to content

Instantly share code, notes, and snippets.

View ejmurray's full-sized avatar

Ernest Murray ejmurray

  • Leeds, UK
  • 23:45 (UTC -12:00)
View GitHub Profile
#!/usr/bin/python
# encoding: utf-8
"""
Description
"""
__author__ = 'Ernest'
__projectName__ = 'untitled'
__date__ = '18/02/15'
__time__ = '20:47'
@ejmurray
ejmurray / birthday.py
Created February 19, 2015 08:34
Calculates the number of days, years from a given birthday.
#!/usr/bin/python
# encoding: utf-8
'''
Calculate the number of years from the entered birthday
'''
__author__ = 'Ernest'
from datetime import date
stryear = raw_input("Enter the year you were born using four digits ")
strmonth = raw_input("Enter the month that you were born in two digits ")
strday = raw_input("Enter the day that you were born in two digits ")
#!/usr/bin/python
# encoding: utf-8
"""This module contains code from
Think Python by Allen B. Downey
http://thinkpython.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
"""This module contains code from
Think Python by Allen B. Downey
http://thinkpython.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
def ackermann(m, n):
#!/usr/bin/python
# encoding: utf-8
"""
Function which calculates the hypotenuse of a right angled triangle
using two different methods.
"""
import math
__author__ = 'Ernest'
#!/usr/bin/python
# encoding: utf-8
"""
Function which calculates the hypotenuse of a right angled triangle
using two different methods.
Exercise 6.2 Think Python
"""
import math
__author__ = 'Ernest'
#!/usr/bin/python
# encoding: utf-8
"""
Description calculate the area of a circle
"""
import math
def distance (x1, y1, x2, y2):
dx = x2 - x1
dy = y2 - y1
@ejmurray
ejmurray / circle-area.py
Created February 23, 2015 08:27
area of a curcle using two functions
#!/usr/bin/python
# encoding: utf-8
"""
calculate the area of a circle using two functions
"""
__author__ = 'Ernest'
import math
def radius(x1, x2, y1, y2):
@ejmurray
ejmurray / tempConversion.py
Created February 24, 2015 13:56
temperature conversion program
#!/usr/bin/python
# encoding: utf-8
# TODO fix the getconverto() function
"""
Temperature conversion program that converts C->F or F->C
C:\Users\ernest\Downloads\Introduction to Computer Science Using Python (1).pdf
page 174(204 in the pdf)
"""
__author__ = 'Ernest'
@ejmurray
ejmurray / tempConversion.py
Created February 25, 2015 13:38
Updated temp conversion
#!/usr/bin/python
# encoding: utf-8
"""
Temperature conversion program that converts C->F or F->C
C:\Users\ernest\Downloads\Introduction to Computer Science Using Python (1).pdf
page 174(204 in the pdf)
"""
__author__ = 'Ernest'