for number in range(1,20,2):
squares.append(number**2)
print(squares)
a=min(squares)
b=max(squares)
c=sum(squares)
print("Max:",a\n"Min:",b\n"Sum:",c)
为什么会这样?
for number in range(1,20,2):
squares.append(number**2)
print(squares)
a=min(squares)
b=max(squares)
c=sum(squares)
print("Max:",a\n"Min:",b\n"Sum:",c)
为什么会这样?
\n 要在引号里面的,你这语法错的有点离谱,字符串格式化输出
print(f"max:{a}\nmin:{b}\nsum:{c}")