【Python 基础】函数调用的小例子
2023-09-11 14:20:28 时间
返回: Python基础 索引页
在下面的例子中,我建立一个函数 sum_two(num_1,num_2)
然后我进行调用 : myresult = sum_two(val_1, val_2)
def sum_two(num_1, num_2): result = num_1 + num_2 return result val_1 = 100 val_2 = 200 myresult = sum_two(val_1,val_2) print ('number#1 is: '+str(val_1) ) print ('number#2 is: '+str(val_2) ) print ('The result is : ' + myresult)
运行结果如下:
number#1 is: 100 number#2 is: 200 The result is : 300
返回: Python基础 索引页
相关文章
- 小白学 Python 爬虫(17):Requests 基础使用
- 小白学 Python(5):基础运算符(上)
- 【python基础】Linux环境下非root用户安装Python和第三方包
- python-django框架-电商项目-项目部署_20191127
- Python每日一练(20230318)
- Python函数详解(二)——函数的参数传递基础
- 【Python基础】python爬虫之异步网络爬虫ǃ
- Python 实现个人博客系统(附零基础python学习资料)
- 女生零基础转行学Java还是python好?
- 〖Python零基础入门篇⑨〗 - 数据类型介绍
- 〖Python零基础入门篇㉗〗- Python中集合的常用方法
- 【Python成长之路】python 基础篇 -- global/nonlocal关键字使用
- Python微信公众号教程基础篇——收发文本消息
- 深度学习“四大名著”发布!Python、TensorFlow、机器学习、深度学习四件套(附免费下载)
- python 进程
- python web py入门(2)-URL处理
- python基础===python自带idle的快捷键
- python基础===获取知乎标题时候,文件编码失败的总结
- python基础===filter在python3中的用法
- Python自动化部署工具-Fabric
- Python 加减计算闯关小游戏
- 【Python】numpy常用API整理汇总