Computer Science, asked by arpeetamohanty, 5 months ago

Write a python programme to input an arithmetic expression and count the number of operators in it. Eg: +, -, / , * ; Expression = 55 - 16 * 2 ; No of operators = 2 ​

Answers

Answered by icishuchoudhary2003
0

Answer:

bodmas:- bracket, division,multiplication,addition and subtraction

Answered by jai696
2

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

operators = lambda s: len([op for op in list(s) if op in ["+", "-", "*", "/"]])

print("operators:", operators((s := input("string: "))))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions