大纲:一.分支结构 if switch二.循环 for while do while break continue三.格式化输出 [printf] int score = 100; String name = "张三": int number = 19; System.out.println(name + "的分数是" + score + "分,排名为第" + number + "名.");换用格式化输出:System.out…
常用的格式化输出方式1 % 方式 print("i am %s my hobby is %s" %("yt","eat")) 打印浮点数,.2表示保留两位. %%表示打印0 “%” 号 print("percent %.2f %%" % 88.5464654) # 结果:88.5464654% 根据字典的键寻值输出 print("i am %(name)s my age is %(age)d" %{&quo…