Python 的 标题格式

等级 128 次按键

这将字符串转换为标题格式。title()方法将每个单词的首字母大写。

Python 代码

# title()返回每个单词首字母大写的新字符串
# "hello world"变为"Hello World",由print()显示
1print("hello world".title())

运行结果

Hello World
用这段代码练习打字

可以用这段代码练习打字。成绩不会计入排行榜。

这段代码中的符号

这段 Python 代码中需要输入的符号及其出现次数。

  • "× 2
  • (× 2
  • )× 2
  • .× 1

Python 等级 1 的更多代码示例

← 返回 Python 打字练习