This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# encoding: utf-8 | |
""" | |
Description | |
""" | |
__author__ = 'Ernest' | |
__projectName__ = 'untitled' | |
__date__ = '18/02/15' | |
__time__ = '20:47' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# encoding: utf-8 | |
""" | |
Function which calculates the hypotenuse of a right angled triangle | |
using two different methods. | |
""" | |
import math | |
__author__ = 'Ernest' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' | |