Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.

Example 1:

Input: "Hello"
Output: "hello"

Example 2:

Input: "here"
Output: "here"

Example 3:

Input: "LOVELY"
Output: "lovely" Code
class Solution:
def toLower(self, s):
ans = ""
for c in s:
if ord('A') <= ord(c) <= ord('Z'):
ans += chr(ord('a') + ord(c) - ord('A'))
else:
ans += c
return ans

最新文章

  1. ETL数据从sqlserver到mysql之间迁移
  2. (原创)RS232串口信号定义
  3. android 开发之 百度地图的使用
  4. ASP.NET MVC中从后台控制器(Controller)传递数据到前台页面视图(View)方式
  5. 基于CoreText的基础排版引擎
  6. yii uploadfile 错误提示: fileinfo php extension is not installed
  7. 用SQL语句操作数据库
  8. http协议Authorization认证方式在Android开发中的使用
  9. osip及eXosip的编译方法
  10. DotNet程序汉化过程--SnippetCompiler简单解说
  11. Python -- 文档测试
  12. AngularJS中的$http.post与jQuery.post的区别
  13. 大数据学习系列之一 ----- Hadoop环境搭建(单机)
  14. 解决mariadb grant ERROR 1045 (28000): Access denied for user
  15. 分享:纯 css 瀑布流 和 js 瀑布流
  16. Pytorch 资料汇总(持续更新)
  17. linux Vue+nginx+django 实现前后端分离
  18. Tomcat的相关配置问题
  19. destoon源码解读
  20. ListView的另一种可读性更强的ViewHolder模式写法

热门文章

  1. Project Move from Qt 4 to Qt 5 项目工程的迁移
  2. bochs
  3. DB2 Version 10.5 补丁下载
  4. Cnblog Markdown编辑器
  5. CH 1402 - 后缀数组 - [字符串hash]
  6. angular validation 使用总结
  7. deepin中Tomcat添加执行权限
  8. zabbix监控Windows-server
  9. flash插件如何生成
  10. Servlet (二)ServletContext