Computer Science, asked by bichazoheb, 9 months ago

accept 5 numbers in a while loop and find the product in python​

Answers

Answered by Anonymous
6

Program in python:

# Appending all input values in list

a = 1

k = []

while a < 6:

  num = int(input("Enter numbers: "))

  k.append(num)

  a = a + 1

# Creating function to multiply all numbers in list

def mult(L) :

   result = 1

   for x in L:

        result = result * x

   print(result)

# Calling function

mult(k)

For sample output refer to attachment

Attachments:
Similar questions