calculadora python code example
Example: calculator python
#this is a fraction calculator
def fractions_regular(fractions):
f1 = input(13,25)
f1 = fractions.Fraction(f1)
f2 = input(6,25)
f2 = fractions.Fraction(f2)
operation = input('what is your iperation?')
if operation == '+':
print('{} + {} = {}'.format(f1, f2, f1 + f2))
if operation == "-":
print('{} - {} = {}'.format(f1, f2, f1 - f2))
if operation == "*":
print('{} * {} = {}'.format(f1, f2, f1 * f2))
if operation == "/":
print('{} / {} = {}'.format(f1, f2, f1 / f2))