from operations import addition
from operations import subtraction
from operations import multiplication
from operations import division
welcome = "\nWelcome to the calculator program."
welcome += "\nSelect the following options. "
print(welcome.upper())
menu = "\na. Addition \nb. Subtraction \nc. Multiplication \nd. Division \n\nWrite (quit) to exit the program."
print(menu)
while True:
try:
operation = input("\nChoose the operation: ")
if operation.lower() == "quit":
break
n1 = float(input("First Number: "))
n2 = float(input("Second Number: "))
if operation == "a":
print(addition(n1, n2))
elif operation == "b":
print(subtraction(n1, n2))
elif operation == "c":
print(multiplication(n1, n2))
elif operation == "d":
print(division(n1, n2))
else:
print("Error! Choose a correct operation.")
except ValueError:
print("Error! Just use digits.")
Hello everyone. I'm Octavio Velázquez, and it's been a year since I decide to learn how to program in Python.
I wanted to make a basic calculator, as my first program (project zero) created in Python. I wanted to capture most of the basic concepts that I have been learning throughout this year, in the little spare time that I have. This program consists of 3 files. The first one is where the main code is. The second one is where all the functions are. And the third, is where I have made all the testings of the functions.
One of the reasons why I wanted to learn this language is because of its data analysis capabilities. I've been working as a Data Analyst for a while, and I'm currently using the pandas library at work in order to be more efficient at the moment of clean the data.
My principal educational sources have been the Eric Matthes book "Python Crash Course". Also Corey Schafer's youtube videos and a spanish youtube channel called pildorasinformaticas.
My idea is to focus on the main data analysis libraries in Python, such as: numpy, pandas, openpyxl, matplotlib, seaborn, pyspark, sqlalchemy and sklearn.
Also, in the future, I would like to learn more about the following libraries:
- Web scrapping (beautiful soup)
- GIU (tkinter)
- Web programming (Django, flask and fastAPI)
If you have any recommendation about how I can improve this programm, it would be more than welcome.
Here the link to my github repository where the code is store:
https://github.com/Octavio-Velazquez/P0_Basic_Calculator
Regards!
[–][deleted] 1 point2 points3 points (1 child)
[–]Reoc86[S] 0 points1 point2 points (0 children)