博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python 复习之 函数返回值
阅读量:6859 次
发布时间:2019-06-26

本文共 311 字,大约阅读时间需要 1 分钟。

1. python中返回值的类型,当然还可以组成其他的类型

  tuple

def returnValue(a,b):    c = a+b    return (a,b,c)x,y,z = returnValue(1,2)print 'x:',x,'y:',y,'z:',z

  list

def returnValue(a,b):    c = a+b    return [a,b,c]x = returnValue(1,2)print x

  dict

def returnValue(a,b):    c = a+b    return {a:c,b:c}x = returnValue(1,2)print x

  

转载地址:http://ouxyl.baihongyu.com/

你可能感兴趣的文章
dotnet core 开发无缝兼容Http和Websocket协议的接口服务
查看>>
对啊英语音标---四、双元音常见的字母发音组合有哪些
查看>>
Resource 定位、BeanDefinition 的载入和解析,BeanDefinition 注册。
查看>>
PHP模拟登录发送闪存
查看>>
com.sun.mirror的jar包
查看>>
非常详尽的 Shiro 架构解析
查看>>
负载均衡获得真实源IP的6种方法 【转】
查看>>
Windows远程协助相关汇总
查看>>
MySql(十六):MySql架构设计——MySQL Cluster
查看>>
HTML5手机页面里面如何把长按复制避免
查看>>
模拟Spring中applicationContext.xml配置文件初始化bean的过程
查看>>
Signal Shading Theory?
查看>>
[转]ASP.NET HttpModule for handling session end with StateServer
查看>>
Creating and Using Static Libraries for iPhone using Xcode 4.3
查看>>
OkHttp3几个简单的例子和在子线程更新UI线程的方法
查看>>
Flash lite for Windows Mobile?!
查看>>
(原創) DE2_NIOS_Lite 1.2 (SOC) (Nios II) (SOPC Builder) (DE2)
查看>>
【吵架不能吵半截】
查看>>
编程获取神鬼传奇客户端安装路径
查看>>
Win32 SDK(对话框程序)
查看>>