Stefan Ram
2024-04-01 08:40:41 UTC
Q: How can I multiply two variables in Python? I tried:
a = 2
b = 3
print( ab )
but it did not work.
A: No, this cannot work. To multiply, you need the multiplication
operator. You can import the multiplication operator from "math":
Code example:
from math import *
a = 2
b = 3
print( a * b )
a = 2
b = 3
print( ab )
but it did not work.
A: No, this cannot work. To multiply, you need the multiplication
operator. You can import the multiplication operator from "math":
Code example:
from math import *
a = 2
b = 3
print( a * b )