function python怎么用
【摘要】在Jupyter notebook里面新建一个python文件。简单地定义一个FUNCTION函数。deffunction1(): print("thisisfunction1") print("function1is

在Jupyter notebook里面新建一个python文件。
简单地定义一个FUNCTION函数。
def function1():
print("this is function1")
print("function1 is here")
print("out of the function1")
然后调试function1()就可以看到该函数里面的内容。
this is function1
function1 is here
相关推荐:《Python教程》
定义FUNCTION函数后,可以不断重复使用。
FUNCTION括号里面还可以增加数字。
def function2(x):
return 2*x
hoo = function2(8)
print(hoo)
结果如下:
16
FUNCTION括号里面可以存在两个数字。
def function4(x, y):
return x - y
woo = function4(8, 5)
print(woo)
结果如下:
3
FUNCTION函数可以同时定义PRINT和括号里的值。
def function5(x):
print(x)
print("this is function5")
return 2*x
tooooo = function5(8)
print(tooooo)
结果如下:
16
上一篇:python入门基础教程
下一篇:eclipse如何写python程序
就业培训申请领取


环球青藤
官方QQ群扫描上方二维码或点击一键加群,免费领取大礼包,加群暗号:青藤。 一键加群
最新文章
Python编程各地入口
环球青藤官方微信服务平台


刷题看课 APP下载
免费直播 一键购课
代报名等人工服务
Python编程热点排行