Just a Web Programmer Blog

Python Programming Homework 1

June 20th, 2007 Posted in My Life, Programming, Schoolwork

อาจารย์ให้เมื่อวันที่ 19/6/50

even.py

# even.py## A function that used to test if a number is even or not## Written by Prem Sichanugrist (48050892)#

def even(number) :    return (number % 2 == 0)

hypotenuse.py

# hypotenuse.py## A function that will calculate a length of hypotenuse# side of a right triangle given both other sides.## Written by Prem Sichanugrist (48050892)#

import math

def hypotenuse(side1, side2) :    return math.sqrt(float(side1) ** 2 + float(side2) ** 2)

การบ้านเสดแล้ว เย้!

Tags:

Related posts

Post a Comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image