The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
Basic calculator
Posted by: Jonas | July 26, 2010 @ 6:28pm
Python Code
[
Download
]
# Inside, stop looking in here. # No, really, STOP. You'll ruin the fun of a (probably) broken calculator. D: loop = 1 choice = 0 while loop == 1: print "So, I noticed you like calculators." print "----------------------------------------------------" print "What would you like to do?" print "1) Add" print "2) Subtract" print "3) Multiply" print "4) Divide" print "5) Quit (OH GOD, PLEASE, NO, DON'T DO IT! I'LL DIE!" print "----------------------------------------------------" choice = input("Choose your option:") if choice == 1: add1 = input("Add") add2 = input("To") print add1, "+", add2, "=", add1 + add2 elif choice == 2: sub1 = input("Take") sub2 = input("Away from") print sub2, "-", sub1, "=", sub2 - sub1 elif choice == 3: multiply1 = input("Multiply") multiply2 = input("By") print multiply1, "*", multiply2, "=", multiply1 * multiply2 elif choice == 4: divide1 = input("Divide") divide2 = input("By") print divide1, "/", divide2, "=", divide1 / divide2 elif choice == 5: loop = 0 print "NOW GTFO MY CALCULATOR (Oh, and gimmeh your comment on IRC. :3"
Syntax Highlighting
[
Open in new window
]
Author Comments
Somthing basic I made in about 15 mins. (I'm still a beginner.)
Rating
4.56 / 8
34 Votes
http://codebin.yi.org/760
page generated in 0.01 seconds