Computer Science, asked by nandana3229, 11 hours ago

Write the program to get the output of the given expression
1×2×3​

Answers

Answered by anindyaadhikari13
7

\textsf{\large{\underline{Solution}:}}

The given problem is solved using language - Python.

expression='1 * 2 * 3'

result=eval(expression)

print('Expression: '+expression)

print('Result:',result)

\textsf{\large{\underline{Explanation}:}}

  1. Line 1: Stores the expression given.
  2. Line 2: Evaluates the given expression using eval() method.
  3. Line 3: Prints the expression given.
  4. Line 4: Prints the result after evaluating the expression.

See attachment for output.

Attachments:
Similar questions