自定义函数(def):创建和调用

1.函数的创建和调用

>>> def MyFirstFunction():
	print('hello')

	
>>> MyFirstFunction()
hello
>>> 
>>> def test(name):
	print(name)

	
>>> test('itxds')
itxds
>>> def add(num1,num2,num3):
	return num1+num2+num3

>>> add(1,2,3)
6
>>> 

 

posted @ 2020-08-01 21:39  coder_xds  阅读(1147)  评论(1编辑  收藏  举报