From 41441e579feb326af11fe0bc3ad0bbccaf67b17b Mon Sep 17 00:00:00 2001 From: Roid Maulana Date: Wed, 9 Oct 2019 11:42:04 +0700 Subject: [PATCH 1/2] Initial commit --- calc_main.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 calc_main.py diff --git a/calc_main.py b/calc_main.py new file mode 100644 index 0000000..0de8c76 --- /dev/null +++ b/calc_main.py @@ -0,0 +1,64 @@ +import math +while True: + print("MENU") + print("1 for addition :") + print("2 for subtraction :") + print('3 for multiplication :') + print("4 for raise to power:") + print("5 for Division:") + print("6 for floor division:") + print("7 for factorial:") + choice=int(input("enter any choice:")) + def additon(): + a=int(input("enter 1st no to perform addition:")) #a-first input + b=int(input("enter 2nd no to perform addition:")) #b-second input + c=a+b + print("sum is:",c) + return + def subtract(): + a = int(input("enter 1st no to perform subtraction:")) + b = int(input("enter 2nd no to perform subtraction:")) + c = a - b + print("subtraction is:", c) + return + def multiplication(): + a = int(input("enter 1st no to perform multipication:")) + b = int(input("enter 2nd no to perform multiplication:")) + c = a*b + print("multiplication is:", c) + return + def power(): + a = int(input("enter base :")) + b = int(input("enter power :")) + c = a**b + print("division is:", c) + return + + def divide(): + a = int(input("enter 1st no to perform division:")) + b = int(input("enter 2nd no to perform division:")) + c = a/b + print("division is:", c) + return + def floor_division(): + + + def factorial(): + + if choice==1: + additon() + elif choice==2: + subtract() + elif choice==3: + multiplication() + elif choice==4: + power() + elif choice==5: + divide() + elif choice==6: + floor_division() + elif choice==7: + factorial() + else: + print("wrong input") + exit(0) \ No newline at end of file From 327a29c018e96d0730530e2c6802e8cfd571d876 Mon Sep 17 00:00:00 2001 From: Roid Maulana <22772929+roidsaja@users.noreply.github.com> Date: Thu, 10 Oct 2019 09:22:40 +0700 Subject: [PATCH 2/2] added badges and fix typo --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4613510..0cd6843 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/) +- - - - + +``` + _____ _ _ _ _ _____ _ _ _____ _ _ _ + / ____| | (_) | | | / ____(_) | | / ____| | | | | | | + | (___ | |_ _ _ _ __ _ __| | |_ _ | (___ _ _ __ ___ _ __ | | ___ | | __ _| | ___ _ _| | __ _| |_ ___ _ __ + \___ \| __| | | | '_ \| |/ _` | | | | | \___ \| | '_ ` _ \| '_ \| |/ _ \ | | / _` | |/ __| | | | |/ _` | __/ _ \| '__| + ____) | |_| |_| | |_) | | (_| | | |_| | ____) | | | | | | | |_) | | __/ | |___| (_| | | (__| |_| | | (_| | || (_) | | + |_____/ \__|\__,_| .__/|_|\__,_|_|\__, | |_____/|_|_| |_| |_| .__/|_|\___| \_____\__,_|_|\___|\__,_|_|\__,_|\__\___/|_| + | | __/ | | | + |_| |___/ |_| + +``` + # Stupidly Simple Calculator A simple python program to do basic calcuation from cli !! @@ -18,7 +33,7 @@ Currently planned features: ### Basic Arithmetics -basic arithmetics will support 4 basic floating point operators: +basic arithmetics will support basic floating point operators: 1. **Addition** 2. **Substraction** 3. **Multiplication** @@ -29,13 +44,13 @@ basic arithmetics will support 4 basic floating point operators: #### Installation #### * requires python ver 2.7 +* cd path to stupidly_simple_calculator * to run simply type in cli `python calc_main.py` ## Note This project is intended for Collaborative Computing class assignment, do not take this program too seriously :) - -- - - - +Feel free to contribute, ## License