Tuesday, March 17, 2015

Multiplication In Python - Python Numbers - Python Tutorial

Multiplication in PythonMultiplication In Python


In this Python tutorial, we will be focusing on multiplication in Python. Multiplication is another simple concept in the Python programming language. We use the asterisk(*) to indicate multiplication.


Examples of Multiplication In Python


#Examples of Multiplication In Python

#Integers
>>> 7 * 8
56
>>> 33 * 98
3234
>>> 44 * 7
308
>>> 23 * -4
-92

#floats
>>> 7.8 * 9.5
74.1
>>> 8.65 * 7.34
63.491
>>> 67.23 * 56.8
3818.664

Multiplication is so straightforward in Python that there is not much to it.  I suggest you play around with multiplication if you run in to float that not returning like they should then go ahead and try to fix them using round() or decimal module.


If you have any questions about multiplication in Python leave a question in our Q & A section of our website.



No comments:

Post a Comment