# 返回绝对值 n = [-1, 1.1, 3+4j] for i in n: print(abs(i)) # 如果参数为complex,则返回其模运算结果 转载于:https://www.cnblogs.com/ShuComputerProgram/p/10339302.html