Chinaunix首页 | 论坛 | 博客
  • 博客访问: 21056
  • 博文数量: 27
  • 博客积分: 585
  • 博客等级: 中士
  • 技术积分: 270
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-20 17:11
文章分类

全部博文(27)

文章存档

2013年(1)

2012年(26)

我的朋友
最近访客

分类: Python/Ruby

2012-12-27 10:43:07

二十七、局部变量的使用

 

 

age = 22

name = 'Swaroop'

print '%s is %d years old' % (name, age)  #注意使用

print 'Why is %s playing with that python?' % name

 

 

二十八、python中语句很长的时候

 

s = 'this is a string .\

     This continues the string

'

print s

 

它的输出是 This is a string .this continues the string

 

二十九、python中特殊字符

**   幂      返回x的y次幂 3**4得到81 既是3的4次幂

//   取整除  返回商的整数部分  4//3.0得到1.0

阅读(141) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~