这一个章节我们来说说怎么建立一个python程序 1.打开idle 2.点击File->new file,然后会弹出一个编辑窗体 3.在编辑窗体里面输入命令代码 程序代码: print("hello world") print("i am ray") print("i love China \n" * 8) print("welcome to my class") print("over") 4.点击…
承接上一章节.我们这一节来说说字符串格式化的还有一种方法.就是调用format() >>> template='{0},{1} and {2}' >>> template.format ('a','b','c') 'a,b and c' >>> template='{name1},{name2} and {name3}' >>> template.format (name1='a',name2='b',name3='c') 'a,b…