分类: 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