Python | Multiplying Elements in a List by Number

For multiplying all of numbers in a Python List with some specific number just use List Comprehension like [element * number for element in list]
Below are some examples of Python Code showing Multiplication of Elements of a List by a number.

Example 1

# Python code for multiplying numbers in List with a specific number
a_list = [12, 94, 92]

multiplied_list = [element * 3 for element in a_list]

print(multiplied_list)
# Return [36, 282, 276]

Example 2

# Python code for multiplying numbers in List with a specific number
a_list = [37, 91, 73]

multiplied_list = [element * 5 for element in a_list]

print(multiplied_list)
# Return [185, 455, 365]

Example 3

# Python code for multiplying numbers in List with a specific number
a_list = [36, 28, 81]

multiplied_list = [element * 10 for element in a_list]

print(multiplied_list)
# Return [360, 280, 810]

More About Python Lists

Gagan

Hi, there I'm founder of ComputerScienceHub(Started this to bring useful Computer Science information just at one place). Personally I've been doing JavaScript, Python development since 2015(Been long) - Worked upon couple of Web Development Projects, Did some Data Science stuff using Python. Nowadays primarily I work as Freelance JavaScript Developer(Web Developer) and on side-by-side managing team of Computer Science specialists at ComputerScienceHub.io

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts