print "\nHaving fun with preprocessor directives\n"
NUMBER = 7
print "\nLucky Number ", NUMBER , "\n"
NUMBER = 7
print "\nLucky Number ", NUMBER , "\n"
NUMBER = 5
def area(l,w):
return l * w
length = 0
width = 0
length = int(raw_input("\nEnter length: "))
width = int(raw_input("\nEnter width: "))
print "\nArea of rectangle = " , area(length,width) , "\n"
def RESULT(x,y):
print "\nResult is \n", x+y
num1 = 0
num2 = 0
num1 = int(raw_input("\nEnter first number: "))
num2 = int(raw_input("\nEnter second number: "))
RESULT(num1,num2)
def RESULT(x,y):
print "\nResult is \n", x+y
operand1 = 0
operand2 = 0
operand1 = int(raw_input("\nEnter first operand: "))
operand2 = int(raw_input("\nEnter second operand: "))
RESULT(operand1,operand2)
import profit
print "\nThe Profit Program\n"
price = float(raw_input("\nEnter unit price: "))
quantity = int(raw_input("Enter quantity sold: "))
totalCost = float(raw_input("Enter total cost: "))
profit1(price,quantity,totalCost)
"""
Header file:- profit.py
def profit(p,q,tc):
print "\nYour profit is ",(p * q) - tc,"\n"
"""
import calculate
selection = 0
print "\n The Function Wizard \n"
print "\n1\tDetermine perimeter of ractangle\n"
print "\n2\tDetermine area of rectangle\n"
print "\n3\tDetermine volume of rectangle\n"
selection = int(raw_input("\nEnter selection : "))
if selection == 1:
l = float(raw_input("Enter length: "))
w = float(raw_input("Enter width: "))
perimeter(l,w)
elif selection == 2:
l = float(raw_input("Enter length: "))
w = float(raw_input("Enter width: "))
area(l,w)
elif selection == 3:
l = float(raw_input("Enter length: "))
w = float(raw_input("Enter width: "))
h = float(raw_input("Enter height: "))
volume(l,w,h)