在Python中,乘法运算使用星号 `*` 表示。以下是一些示例:
数值相乘a = 5b = 6product = a * bprint(product) 输出:30字符串重复s = "hello"repeated_s = s * 3print(repeated_s) 输出:hellohellohello列表重复list1 = [1, 2, 3]list2 = list1 * 2print(list2) 输出:[1, 2, 3, 1, 2, 3]
此外,Python还支持乘方运算,使用两个星号 ` ` 表示:

```python
c = 2 3
print(c) 输出:8
还有使用 `pow` 函数表示乘方的方式:
c = pow(2, 3)
print(c) 输出:8
需要注意的是,在Python中,`*` 运算符不仅可以用于数值相乘,还可以用于字符串连接和列表重复等操作
