multiply two numbers in python

To multiply two numbers in Python, you can use the arithmetic operator *. Here's an example:

main.py
num1 = 10
num2 = 5
product = num1 * num2
print(product)
56 chars
5 lines

In the above code, we have two variables num1 and num2, which contains the values 10 and 5 respectively. We use the * operator to multiply these two numbers together and store the result in a third variable called product. Finally, we print out the value of product, which should be 50.

gistlibby LogSnag