7_Creating python Calculator mini project

แชร์
ฝัง

ความคิดเห็น • 1

  • @learningStar_s
    @learningStar_s  12 วันที่ผ่านมา

    #Getting inputs for our calculater
    FirstNumber = float(input("Enter the first number:"))
    SecondNumber = float(input("Enter the second number:"))
    Operation = input("Select an operation (+, -, *, /):")
    if Operation =="+":
    # creating + function
    Answer = FirstNumber + SecondNumber
    if Operation =="-":
    #Creating - function
    Answer = FirstNumber - SecondNumber
    if Operation =="*":
    #Creating * function
    Answer = FirstNumber * SecondNumber
    if Operation =="/":
    #Creating / function
    Answer = FirstNumber / SecondNumber
    #Creating outputs
    print("The result of",FirstNumber,Operation,SecondNumber,"is",Answer)