0

Code

How to solve a simple calculation using codes

26th Apr 2021, 8:11 AM
Lufungulo Jackson Twange
Lufungulo Jackson Twange - avatar
2 ответов
+ 1
Declare a variable and then just write whatever you want to calculate. Its the same as your scientific calculator. Example, x = 1+2*3+6/3+(3-1) print(x) Bit advanced: If you want to take the expression as input, then do this, y = input() x = eval(y) print(x)
26th Apr 2021, 8:24 AM
Md. Faheem Hossain
Md. Faheem Hossain - avatar
+ 1
Lufungulo Jackson Twange # define functions. def add(x, y): """This function adds two numbers"" return x + y. def subtract(x, y): """This function subtracts two numbers""" return x - y. def multiply(x, y): https://www.javatpoint.com/JUMP_LINK__&&__python__&&__JUMP_LINK-make-simple-calculator
27th Apr 2021, 10:38 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar