Answers for "code ofr a calculator"

8

calculator code

x = input("first number")
y = input("second number")
z = input("do you want to multiply, minus, divide or add? (x,-,/,+)")

y = int(y)
x = int(x)

if z == "+":
    print (x + y)

if z == "/":
    print (x / y)

if z == "x":
    print (x * y)

if z == "-":
    print (x - y)

else:
    print("use x,-,/ or + next time!")
Posted by: Guest on June-04-2020
0

how to make a calculator websiteJS

let add =(...params) => {
    let sum = 0;
    params.forEach(el =>{
        sum = sum + parseInt(el);
    })
    return sum
}

document.querySelector('.add').addEventListener('click' , function (e)
Posted by: Guest on June-27-2020

Browse Popular Code Answers by Language