GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python/SimpleCalculator.py at master · TensorUI/Python Expand file tree/ Copy pathSimpleCalculator.pyMore file actions 32 lines (26 loc) · 648 Bytes / Copy pathSimpleCalculator.pyFile metadata and controls32 lines (26 loc) · 648 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 def add(a,b): return a+b def subtract(a,b): return a-b def multiply(a,b): return a*b def divide(a,b): return a/b print("Select Operation") print("1.Add") print("2.Subtract") print("3.Multiply") print("4.Divide") choice = input("Enter Choice(1/2/3/4):") num1 = int(input("Enter first number: ")) num2 = int(input("Enbter Second number:")) if choice == '1': print(num1,"+",num2,"=", add(num1,num2)) elif choice == '2': print(num1,"-",num2,"=", subtract(num1,num2)) elif choice == '3': print(num1,"*",num2,"=", multiply(num1,num2)) elif choice == '4': print(num1,"/",num2,"=", divide(num1,num2)) else: print("Invalid input") |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |