python学习笔记7-函数返回值
使用return指定isNum()的函数返回值是true或者false,
[[email protected] ~]# vim return.py
#!/usr/bin/python
import os
import sys
def isNum(s):
if s.isdigit():
return True
return False
for i in os.listdir(‘/proc‘):
if isNum(i):
print i
时间: 2024-12-17 05:17:55