流程控制:假如

#-*- coding: utf-8 -*-
print("簡易四則運算")
n1=int(input("請輸入數字一: "))
n2=int(input("請輸入數字二: "))
op=input("請輸入 + - * /: ")
if op=="+":
    print(n1+n2)
elif op=="-":
    print(n1-n2)
elif op=="*":
    print(n1*n2)
elif op=="/":
    print(int(n1/n2))
else:
    print("不支援的運算符號")

Last updated