1 Star 0 Fork 0

AceBear/kids-python

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
2_String.py 492 Bytes
一键复制 编辑 原始数据 按行查看 历史
AceBearXP 提交于 2022-01-17 22:47 +08:00 . Lesson06
# string
slogan = "I've finished my homework!"
slogan2 = '我已经写完了作业!'
str3 = '2.98'
print(slogan)
print(slogan2)
print(str3)
# string template
what = "橙子"
when = "昨天"
how_many = 2
txt = f"我{when}吃了{how_many}{what}"
print(txt)
# 千万不要打错试一试
print(f"我{when}吃了{how_many:.3f}{when}")
how_many = 1.5
print(f"我{when}吃了{how_many:.2f}{what}")
answer = 4 / 3
print(f"1) 4367 - 112 x 34 = {answer:.3}")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/acebear/kids-python.git
git@gitee.com:acebear/kids-python.git
acebear
kids-python
kids-python
master

搜索帮助