score = 55
if score >= 60:
print 'passed'
else:
print 'failed'
print
if score >= 60:
print 'passed'
else:
print 'failed'
2019-01-24
L = [95.5, 85, 59]
print L[-1]
print L[-2]
print L[-3]
print L[-1]
print L[-2]
print L[-3]
2019-01-24
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[0]
print L[1]
print L[2]
2019-01-24
最赞回答 / Awful_Leo
可以L = ['Adam', 'Lisa', 'Paul', 'Bart']L.pop(2) and L.pop(2)print Land在这里符合短路原则,如果and换成or就不行了。
2019-01-24
print ['Adam', 95.5, 'Lisa', 85,'Bart', 59]
2019-01-24
# -*- coding: utf-8 -*-
print ''' '静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。' '''
print ''' '静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。' '''
2019-01-23
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.'''
2019-01-23
s = 'Python was started in 1989 by \"Guido\". ' '\nPython is free and easy to learn.'
print s
print s
2019-01-23
s = 'Python was started in 1989 by \"Guido\". \n Python is free and easy to learn.'
print s
print s
2019-01-23
x1 = 1
d = 3
n = 100
x100 = x1 + (n-1)*d
s = (x1 + x100)*n/2
print s
d = 3
n = 100
x100 = x1 + (n-1)*d
s = (x1 + x100)*n/2
print s
2019-01-23
a = 'python'
print 'hello,', a or 'world'
# 短路计算or的情况下, a 的值为True,返回 a
b = ''
print 'hello,', b or 'world'
#短路计算or的情况下, b的值为false, 则返回 world
print 'hello,', a or 'world'
# 短路计算or的情况下, a 的值为True,返回 a
b = ''
print 'hello,', b or 'world'
#短路计算or的情况下, b的值为false, 则返回 world
2019-01-23