python程序中的小问题
formatting是格式的意思,再看看代码发现print('There are &d letters, %d spaces, %d digits and %d other characters in your string.' %(letter,space,digit,other))letters前面的%d写成了&dpython中%d表示格式化一个对象为十进制整数,使用后,在需要输出的长字符串中占位置。输出字符串时,可以依据变量的值,自动更新字符串的内容。...
原创
2021-11-26 15:08:44 ·
669 阅读 ·
0 评论