Answer to Question #219726 in Python for janardhan

Question #219726

n the given example, N = 3 and the input integers are 2, 3, and 7.So, the output should be 2 x 3 x 7 = 42.


1
Expert's answer
2021-07-22T18:46:49-0400
N = int(input())
l = list(map(int, input().split()))
foo = 1
s = ''
for i in l:
    foo*=i
    s = s + (str(i)+'x')
print(s[:-1]+'='+str(foo))

Sample Input 1:
3
2 3 7
Sample Output 1:
2x3x7=42

Sample Input 2:
4
1 2 3 4
Sample Output 2:
1x2x3x4=24

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS