Python 条件判断的缩写方法 pythontty 阅读 16 2008-09-06 12:16:13 return (1==1) ? "is easy" : "my god" //C#中的用法 其实,在Python中,是这样写的: print (1==2) and 'Fool' or 'Not bad' 输出结果: Not bad python bad 判断 条件 缩写 return print 上一篇 Python 时间处理datetime实例 下一篇 Python 过滤字符串的技巧,map与itertools.imap