码迷,mamicode.com
首页 > 编程语言 > 详细

Python3 upper()方法

时间:2018-07-03 11:34:37      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:div   oob   col   str   amp   run   from   this   rom   

描述

Python upper() 方法将字符串中的小写字母转为大写字母。

语法

upper()方法语法:

str.upper()

参数

  • NA。

返回值

返回小写字母转为大写字母的字符串。

实例

以下实例展示了 upper()函数的使用方法:

1 #!/usr/bin/python3
2 
3 str = "this is string example from runoob....wow!!!";
4 
5 print ("str.upper() : ", str.upper())

以上实例输出结果如下:str.upper() :  THIS IS STRING EXAMPLE FROM RUNOOB....WOW!!!

Python3 upper()方法

标签:div   oob   col   str   amp   run   from   this   rom   

原文地址:https://www.cnblogs.com/dillon-china/p/9256891.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!