4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Four-Processor Calculator

print "+ ---> collection"
print "- ---> sticker"
print "* ---> impact"
print "/ ---> chamber"

while (True):
op = raw_input ("choose action:")
if (op == "+"):
op1=input("enter first number:")
op2=input("enter second count:")
print op1+op2
elif (op == "-"):
op1=input("enter first number:")
op2=input("enter second count:")
print op1-op2
elif (op == ""):
op1=input("enter first number:")
op2=input("enter second number:")
print op1
op2
elif (op == "/"):
op1=input("enter first number:")
op2=input("enter second number:")
if (op2== 0):
print "A number can not be divided by 0."
else:
print"op1/op2"
else:
print "indeterminate operation!"

4 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: