To multiply two numbers in Python, you can use the arithmetic operator *
. Here's an example:
main.py56 chars5 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