鱼C论坛

 找回密码
 立即注册
查看: 1553|回复: 2

函数无法插入参数

[复制链接]
发表于 2020-2-22 10:10:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
我用的是pychram,但是很多时候输入代码没有出现想要的结果而是,只输出了“Process finished with exit code 0”程序无错误结束的标志?我想问一下这个要怎么帮呢
def MyFun(x, y):
    print( x[0] * x[1] - y[0] * y[1])

# 运行的结果是
D:\02.木籽研而\001.Python\python的小成果\venv\Scripts\python.exe "D:/02.木籽研而/001.Python/python的小成果/the seventh day.py"

Process finished with exit code 0
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2020-2-22 10:11:50 From FishC Mobile | 显示全部楼层
函数无调用
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-2-22 10:19:28 | 显示全部楼层
刚刚弄明白了,这上面的意义是正确的创建了函数
但是还有调用这个函数,输入实际参数才可以显示结果!
def MyFun(x, y):
    print( x[0] * x[1] - y[0] * y[1])
MyFun((1,2),(2,4))
D:\02.木籽研而\001.Python\python的小成果\venv\Scripts\python.exe "D:/02.木籽研而/001.Python/python的小成果/the seventh day.py"
-6

Process finished with exit code 0
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2026-1-22 18:25

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表