已采纳回答 / 慕粉3506778
计算顺序有问题,(weight / height * height)的计算结果就是weight,正确的写法是(weight / (height * height))
2016-09-04
L = ['Adam', 'Lisa', 'Bart']
#先找到索引为2的位置,在它前面插入
# L.insert(2,'Paul');
# 或者从后面数找到Bart位置为-1,在这个位置插入
L.insert(-1,'Paul')
#先找到索引为2的位置,在它前面插入
# L.insert(2,'Paul');
# 或者从后面数找到Bart位置为-1,在这个位置插入
L.insert(-1,'Paul')
2016-09-04
L = ['Adam', 95.5, 'Lisa', 85, 'Bart', 59]
print L
又想多了,想到了程序排序,……
print L
又想多了,想到了程序排序,……
2016-09-04
# a 相当于true ,在or运算中一真为真,直接短路,返回'hello python'
a = 'python'
print 'hello,', a or 'world'
# a 相当于false ,在or运算中前面的false,取决于后面一个值,返回'hello world'
b = ''
print 'hello,', b or 'world'
a = 'python'
print 'hello,', a or 'world'
# a 相当于false ,在or运算中前面的false,取决于后面一个值,返回'hello world'
b = ''
print 'hello,', b or 'world'
2016-09-04
print r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.'''
刚才把最后的'''另起一行了导致了。
Whether it's nobler in the mind to suffer.'''
刚才把最后的'''另起一行了导致了。
2016-09-04
s = 'Python was started in 1989 by \"Guido\". \nPython is free and easy to learn.'
print s
别忘了英语句号哈呵呵
print s
别忘了英语句号哈呵呵
2016-09-04