美文网首页
Python 14 Programming Tutorial

Python 14 Programming Tutorial

作者: 豆表示低调 | 来源:发表于2016-08-31 11:25 被阅读0次
def get_gender(sex='Unknown'):
    if sex is 'm':
        sex = "Male"
    elif sex is 'f':
        sex = "Female"
    print(sex)

get_gender('m')
get_gender('f')
get_gender()

相关文章

网友评论

      本文标题:Python 14 Programming Tutorial

      本文链接:https://www.haomeiwen.com/subject/heaxettx.html