Last active
March 31, 2016 17:55
-
-
Save anthony-y/b3431eb3e5dcaae7bf0a to your computer and use it in GitHub Desktop.
A very simple yet functional calculator in ~20 lines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calc.py | |
# Simple calculator. | |
from os import system as s | |
nextNum = None | |
operations = [] | |
def getNextNumber(): | |
nextNum = input(">> ") | |
operations.append(float(nextNum)) | |
while True: | |
print "Console Calculator by Anthony Baynham" | |
getNextNumber() | |
for i in operations: | |
print i | |
s("pause") | |
del operations[:] | |
s("cls") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment