>>> score=85
>>> if score>90:
... print 'excellent'
... elif score>80:
... print 'good'
... elif score>60:
... print 'hao'
... else:
... print 'failed'
...
good
>>> if score>90:
... print 'excellent'
... elif score>80:
... print 'good'
... elif score>60:
... print 'hao'
... else:
... print 'failed'
...
good
2016-10-17
已采纳回答 / 慕斯5482594
(1)打开IDLE(Python GUI)--->File--->open--->选你的hello.py 文件所在位置。(会弹出一个新的窗口)(2)在新的窗口下,应该会有你编写的代码,然后在这个窗口点Run--->Run Module 快捷键F5(3)会在IDLE(Python GUI python2.7.12 shell),这个窗口显示结果
2016-10-17
t=('a','b',['A','B']);
t=('a','c',[1,2]);
这么感觉是对t进行重新赋值
t=('a','c',[1,2]);
这么感觉是对t进行重新赋值
2016-10-17
s = '\tPython was started in 1989 by \"Guido\".\n \tPython is free and easy to learn.'
print s
print s
2016-10-17
def square_of_sum(L):
sum=0
for x in L:
sum=x*x+sum
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
sum=0
for x in L:
sum=x*x+sum
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2016-10-17
L = [75, 92, 59, 68]
sum = 0.0
for ad in L:
sum = sum + ad
print sum / 4
sum = 0.0
for ad in L:
sum = sum + ad
print sum / 4
2016-10-17
最新回答 / qq_于志达_04372457
sum = 0x = 1n = 1while True: if n > 20: break sum = sum + x x = x * 2 n = n + 1print sum1048575然而sum = 0x = 1n = 1while True: if n > 20: break n = n + 1 x = x * 2 sum = sum + xprint (sum)2097150为什么?
2016-10-17