Python 字符串格式化
来源:互联网 发布:java代码表白 编辑:程序博客网 时间:2024/05/22 02:15
print 'My age is' + str(18)str1='good'str2='bye'print str1+str2num= 18print 'My age is' + str( num )num= 20print 'My age is %d'%numprint 'Price is %f'%4.99print 'Price is %.2f'%4.99name='crossin'print '%s is a good teacher.'%nameprint '%s %name is a good teacher.'print '%s is a good %name teacher.'print 'Today is %s.' %'Friday'
结果:
My age is18
goodbye
My age is18
My age is 20
Price is 4.990000
Price is 4.99
crossin is a good teacher.
%s %name is a good teacher.
%s is a good %name teacher.
Today is Friday.
0 0
- Python字符串格式化符号
- PYTHON 字符串格式化
- 字符串格式化(python)
- Python:字符串格式化
- python字符串格式化
- Python字符串格式化
- Python字符串格式化问题
- python字符串的格式化
- python 格式化字符串
- Python字符串格式化
- python 格式化时间字符串
- python 格式化字符串
- python 字符串格式化
- Python中的格式化字符串
- Python字符串格式化
- python format格式化字符串
- Python字符串格式化
- Python字符串格式化
- APP接口设计安全问题
- WAMP环境安装完成后修改数据库密码和登陆不上mysqladmin的解决方法
- MyBatis和Hibernate的比较
- Android 多线程-----AsyncTask详解
- HTML5 weui笔记
- Python 字符串格式化
- Java中日期类,日历类的使用
- 工厂方法模式
- 实现登录界面的“记住我”功能 JAVA
- textView实现placehodle
- STL vector用法
- 关于Redis数据过期策略
- Android依赖注入:Dagger、RoboGuice和ButterKnife比较
- 友盟页面爬虫工具