Skip to content
Menu
Daniel J. Pierce
  • C#
  • Games
  • Graphics
  • Math
  • Python
  • Tynker
  • Unity
Daniel J. Pierce

Python Equation Calculator

Posted on May 9, 2017November 10, 2019

import math
import time
#Don't touch the code in any way!
print('Calculator 0.0')
playAgain = 'yes'    
while playAgain == 'yes' or playAgain == 'y':

    print('Enter a this style of equation:')
    print('3 x + 2 = 14 or 3 x - 23 = 15')
    print('There must be spaces between all numbers and characters.')
    a,b,c,d,e,f = input().split()
    if c == '-':
        g = int(f) + int(d)
    else:
        g = int(f) - int(d)
    h = int(g) / int(a)
    print('Calculating...')
    time.sleep(1)
    print(str(b) + ' = ' + str(h))


    print('Do you want to calculate another number?')
    playAgain = input()

    if playAgain == 'no' or playAgain == 'n':
        print('Sorry to see you go. Please come again.')
        time.sleep(10)



#input(int char + int = int)


Projects

  • Procedure Platforming
  • Particle Simulator
  • AP Computer Science Paint Program
  • Maybe Good Platformer
  • Custom Gravity Test
  • Triangle Types
  • Unity Obstacle Course v1
  • Collapsing rows
  • Java Tic Tac Toe (No AI)
  • Mersenne Prime Tester
  • Rainbow
  • Pong
  • Simple Tkinter Calculator
  • Hexidecimal Converter
  • Snake eats apple
  • Protect the Galactic Empire
  • Hangman
  • Beautiful Colorful Thing
  • Four Dots
  • Frogga
  • Escape asteroids
  • Portals
  • Guess the Number 2.0
  • Illogical
  • Tic Tac Toe
  • Guess the Number
  • Ultimate Calculator 1.0.0a0
  • Prime Number Tester
  • Number Base Converter 2.0a0
  • Number Base Converter 1.1
  • Python Equation Calculator
©2025 Daniel J. Pierce | WordPress Theme by Superb WordPress Themes