[In]
def subtract(a,b):
print=(f"subtracting{a} - {b}")
return a-b
def add(a,b):
print (f"adding{a}+{b}")
return a+b
def multily(a,b):
print(f"multilying {a}*{b}")
return a*b
def divide(a,b):
print(f"dividing{a}/{b}")
return a/b
print('let`s do some math')
candy=subtract(20,5)
soda=add(1,2)
man=multily(10,20)
woman=divide(30,15)
print("There have {} candy {} soda {} man {} woman ".format(candy,soda,man,woman))
###注意format如果要这样用会像这样e.g. print("There heva st{}".format(bug))
#注意後面的brackets
[Out]
let`s do some math
adding1+2
multilying 10*20
dividing30/15
There have 15 candy 3 soda 200 man 2.0 woman
确认是否了解return的意思?
<<: Cobol Picture Clause/cobol field type
你设计的 API 除了跑的动以外,它安全稳定吗? 既然 Junoir 跟 Senior 的後端工程...
每家金流的流程都不太一样,但基本上有牵扯到金钱的东西,肯定会有一堆验证机制, 我们先看一下永丰金的流...
本章开始归纳出几个K8s特性可以提升AI效能并以Spark计算圆周率Pi示范。原文写於2019如无法...
本节是以 Golang 上游 4b654c0eeca65ffc6588ffd9c99387a7e4...
终於来到第三十天了,感谢关注这篇系列文的读者们愿意看我废话 30 天 XD 进入正题 如果是近两年才...