为了账号安全,请及时绑定邮箱和手机立即绑定
a=2
at=0
while a<=1000:
if a == 1000:
break;
at+=a
a=a+2
print(at)
template = 'Life is short,{}'
A = 'you need Python'
result = template.format(A)
print(result)

template = 'Life is short,{}'
result = template.format('you need Python')
print(result)
print(‘nihao’)
Print("i like movie.")
print(Hello World)
template='Life is {},you need {}'
result=template.format('short','python')
print(result)


template='Life is {s},you need {p}'
short='short'
python='python'
result=template.format(s=short,p=python)
print(result)
print(“hello_world”)
print(“hello”” world”)
# Enter a code
def classmate(**kwargs):
for i in range(0,len(kwargs.get('names'))):
print('{} ,{} ,{}'.format(kwargs.get('names')[i],kwargs.get('gender')[i],kwargs.get('age')[i]))
classmate(names = ['Alice', 'Bob', 'Candy'], gender = ['girl', 'boy', 'girl'], age = [16, 17, 15])
def greet(x=None):
if x != None:
print("Hello,World")
else:
print('hello')



s1=greet(22)
print(s1)
可以这样就行了
def fact(n):
if n==1:
return 1
return n + fact(n - 1)

s2 =fact(100)
print(s2)
>>> print(r'''"To be,or not to be":that is the question.
... Whether it's nobler in the mind to suffer.''')
"To be,or not to be":that is the question.
Whether it's nobler in the mind to suffer.
>>>
课程须知
如果您了解程序设计的基本概念,会简单使用命令行,了解中学数学函数的概念,那么对课程学习会有很大的帮助,让您学起来得心应手,快速进入Python世界。
老师告诉你能学到什么?
通过本课程的学习,您将学会搭建基本的Python开发环境,以函数为基础编写完整的Python代码,熟练掌握Python的基本数据类型以及list和dict的操作,灵活使用流程控制语句。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消