最新公告
  • 欢迎您光临知事网软件APP资源下载站,一个优质的手机App应用商店和网站源码基地。欢迎加入永久SVIP
  • python中upper函数的用法是什么?

    正文概述 知事网   2020-12-23 09:12:11   572

    image.png

    我们知道, 字符串是python中经常使用的码字形式,对于字符串的操作也是很多。对于字符串中的大小写,如果我们需要将小写转换成大写,就要使用python中的字符串函数upper函数。本文主要介绍upper函数的使用过程。

    1、upper()

    作用于字符串中的小写字母转为大写字母。

    2、语法

    str.upper()

    3、返回值

    返回被转为大写字母的字符串

    4、使用实例

    #!/usr/bin/python
    
    str = "this is string example....wow!!!";
    print "str.capitalize() : ", str.upper()

    输出

    str.capitalize() :  THIS IS STRING EXAMPLE....WOW!!!

    以上就是python中upper函数的介绍,希望能对你有所帮助哦~

    转载自:python学习网 https://www.py.cn/


    知事网 » python中upper函数的用法是什么?

    发表评论

    还没有评论,快来抢沙发吧!

    [!--temp.right--]
    请选择支付方式
    ×
    余额支付
    ×
    微信扫码支付 0 元