点击查看代码
message='"Hellw world"'
# 大小写转化
print(message.title())
print(message.lower())
print(message.upper())
first_name = "ruo"
second_name = "ye"
# f字符串,f是format的简写
full_name=f"{first_name} {second_name}"
print(full_name)
print(f"Hello {full_name.title()}")
# 制表或换行符
print("Python")
print("\tPython")
print("Languages:\n\tPython\n\tC\n\tJavaScript")
print("Python",end=' ') # 不换行输出
print("Py")
# 删除字符串两端的空白
test_string = " PY "
print(test_string.rstrip()) # 删除右边空白
print(test_string.lstrip()) # 删除左边空白
print(test_string.strip()) # 删除两边空白
# 删除前缀
url = 'httgub'
urll = url.removeprefix('htt')
print(urll)
# 数字操作
answer = 14_000_000_000
print(answer)
x, y, z = 0, 0, 0