为了账号安全,请及时绑定邮箱和手机立即绑定

初识Python

廖雪峰 移动开发工程师
难度入门
时长 5小时 0分
学习人数
综合评分9.43
3762人评价 查看评价
9.7 内容实用
9.4 简洁易懂
9.2 逻辑清晰
(已通过)正确答案:
print 'hello,python'
print 'hello,','python'
L = range(1,101)
for x in L:
L[x-1]=x*x
print sum(L)
L = ['Adam', 'Lisa', 'Bart']
(L[0],L[2])=(L[2],L[0])
print L
sum = 0
x = 1
while x <= 100:
if x / 2 == 0:
sum = sum +x
elif
print x
print sum
坑爹,dict.iterkeys(),dict.iteritems(),dict.itervalues()方法在python3中都不再支持
for x in range(1,10):
for y in range(x+1,10):
print x*10+y
for x in range(10,100):
if x/10 < x%10:
print x
我也要学会~
sum = 0
x = 0
while True:
x += 1
if x > 100:
break
elif x%2 != 0:
sum += x
else:
continue
print sum

已采纳回答 / 1984的橘子和柠檬_0
用mod函数的话 要加上   from operator import mod
s='Python was started in 1989 by \"Guido\".\nPython is free and easy to learn.'
print s

已采纳回答 / ryoishiki
这里有点小问题,本来已经在第一行规定了unicode之后,字符串前面就不用加u了把字符串前面的u删掉就能够通过了
for x in ['0','1','2','3','4','5','6','7','8','9']:
for y in ['0','1','2','3','4','5','6','7','8','9']:
if x < y :
print x+y
sum = 0
x = 1
n = 1
while True:
sum += 2**(x-1)
x += 1
n += 1
if n > 20:
break
print sum
这样是最正确的,但是与答案不符提示错误

score = 85

if score >= 90:
print 'excellent'
elif score >= 80 and score < 90:
print 'good'
elif score >= 60 and score < 80:
print 'passed'
else:
print 'failed'
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作。

微信扫码,参与3人拼团

微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消