પોસ્ટ્સ

મે, 2021 માંથી પોસ્ટ્સ બતાવી રહ્યું છે

python command line simple calculator

છબી
Code a = input("enter a value: ") b = input("enter a value: ") c = input("enter a choice what you want to do add,sub,mul,dev,pow: ") a = float(a) b = float(b) if c == "add":     ans = a + b     print(ans) elif c == "sub":     ans = a-b     print(ans) elif c == "mul":     ans = a*b     print(ans) elif c == "dev":     ans = a/b     print(ans) elif c == "pow":     ans = a**b     print(ans) else:     print("enter a proper choice") Output   Description   Input() in any program or applaction or software user interaction is required in python provide input () function to take input from user.   Input () function take input and evaluate . Its automatically identify input is number ,string or list. Hear, a=input("enter value") Print message "enter value" on screen and take value and save in variable "a" name.  float() float function give floating point value its convert numbe