python中函数能与数相乘吗

不能,在python中使用“*”号来实现来数相乘。

具体内容如下:

* 语法

a * b //a与b指的是一个整型数值

示例:

>>> a =1

>>> b =2

>>> print(a * b)

2

相关算数运算符:

+:两个数相加,或是字符串连接

-:两个数相减

/:两个数相除,结果为浮点数

//:两个数相除,结果为向下取整的整数

%:取模,返回两个数相除的余数

**:幂运算,返回乘方结果

Both comments and pings are currently closed.

Comments are closed.

Powered by KingAbc | 粤ICP备16106647号-2 | Loading Time‌ 0.502