"i="+str(i,2)
:是显示
"i=",是字符,引号内都是字符
"+"是操作符,将两个字符串连接.
STR()是函数,将数值转换成字符.str(i,2)是将数值型的变量转换成字符型,取2位小数.
"i="+str(i,2):就是显示变量i的值:i=...
相关语法:
| Expression1
[PICTURE cFormatCodes] | [FUNCTION cFormatCodes] | [VnWidth]
[AT nColumn]
[FONT cFontName [,nFontSize] [STYLE cFontStyle | Expression2]]
[,Expression3] ...
STR(nExpression [,nLength [,nDecimalPlaces]])