首页 > 编程语言 > 详细

【Python】简单计算器

时间:2019-12-30 18:08:35      阅读:115      评论:0      收藏:0      [点我收藏+]
#python 3.7.1

print("operation codes are:")
print("1 for multiply")
print("2 for division")
print("3 for addition")
print("4 for subtraction")
num1=int(input("first number here:"))
num2=int(input("second number here:"))
operator=int(input("operation code:"))
while operator is 1:
  print(num1*num2)
  break
while operator is 2:
  print(num1/num2)
  break
while operator is 3:
  print(  num1+num2)
  break
while operator is 4:
  print(  num1-num2)
  break
  

【Python】简单计算器

原文:https://www.cnblogs.com/HGNET/p/12120785.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!