12.7k views
5 votes
Write a Python program where the user enters the number of elements in a list ‘n’ and those ‘n’ numbers that form the list. The user also enters a number ‘m’ by which all the elements of the list are multiplied and printed. You must print both the list before multiplying and the list after multiplied by the number ‘m’.

User VoxPelli
by
5.9k points

1 Answer

1 vote

Answer:

lst = []

multiple = []

num = int(input('How many numbers: '))

multipleOf = int(input('Enter the number to multiply with: '))

for n in range(num):

lst.append(n)

numbers = n * multipleOf

multiple.append(numbers)

print("elements in given list is :", lst)

print("multiple in given list is :", multiple)

Step-by-step explanation:

User will enter the number and then enter the number to multiply that list.

User Novell
by
5.1k points