妈呀,数学不好的话真的连习题都做不出来。能不能不要用数学的习题来做练习任务啊?还说python学习不需要会数学。工作那么多年,数学都完全还给老师了,平时也用不上这些数学知识,差点连题目都看不懂,更别说怎么编写算法公式了,55555
2018-12-21
最赞回答 / qq_颜子明_0
sum=float 是什么鬼??你的意思是说是不是要先定义sum变量: float sum=0.0;在python语言中,我记得是可以不用定义直接使用的。sum=0.0有两个含义,一个是初始化sum,一个是让变量成为浮点数。
2018-12-21
sum = 0
x = 1
while x*2+1 < 100:
sum += (x*2+1)
x = x +1
print sum+1
x = 1
while x*2+1 < 100:
sum += (x*2+1)
x = x +1
print sum+1
2018-12-21
sum = 0
x = 1
while x < 100:
if x%2 != 0 :
sum += x
x = x +1
print sum
x = 1
while x < 100:
if x%2 != 0 :
sum += x
x = x +1
print sum
2018-12-21
sum = 0
x = 1
while x*2+1 < 100:
sum += (x*2+1)
x = x +1
print sum
x = 1
while x*2+1 < 100:
sum += (x*2+1)
x = x +1
print sum
2018-12-21
L = range(1, 101)
print L[:10]
print L[2:100][::3]
print L[4:50][::5]
print L[:10]
print L[2:100][::3]
print L[4:50][::5]
2018-12-21
>>>print(r'''"To be, or not to be": that is the question.
...Whether it's nonler in the mind to suffer.''')
...Whether it's nonler in the mind to suffer.''')
2018-12-20
看了楼下的瞬间明白了,x[0]+x[1]遍历,x[0]取的是元素的首个值,x[1]取的元素的第二值,把s遍历一遍就可以输出了
2018-12-20
x1 = 1
d = 3
n = 100
x100 = 1+(100-1)*d
print(x100)
s = (x1 + x100)*100/2
print s
d = 3
n = 100
x100 = 1+(100-1)*d
print(x100)
s = (x1 + x100)*100/2
print s
2018-12-20
最新回答 / 慕设计2718092
你理解错了,题目只是为了让你理解:第一个 greet()没有参数是让你理解给参数默认值,第二个是输入值覆盖参数默认值你看看这节课的标题就知道了
2018-12-19