image
alpha

代码写的好,bug改到老

免责声明:网站内容仅供个人学习记录,禁做商业用途,转载请注明出处。

版权所有 © 2017-2020 NEUSNCP个人学习笔记 辽ICP备17017855号-2

Python 求平方运算

alpha    2019年8月22日 08:27:21

  1. 使用表达式
  2. 使用内置模块
  3. 使用内置函数
# 1. 表达式
c = 3**2
# 2. 内置模块
import math
a = math.pow(3,2)
# 3. 内置函数
b = pow(3,2)
# 注意:这个不是平方,^是按位异或逻辑运算符,&是按位逻辑运算符,|是按位或逻辑运算符
d = 3^2
print(a, b, c, d)
运行结果(手动添加了换行):
9.0
9
9
1
最近更新: 2019年8月22日 08:29:19
浏览: 2.0K

[[total]] 条评论

添加评论
  1. [[item.time]]
    [[item.user.username]] [[item.floor]]楼
  2. 点击加载更多……
  3. 添加评论