亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
age = 3
if age>18:
print('adult')
elif age > 6:
print('teenager')
elif age > 3:
print('kid')
else:
print('baby')
# Enter a code
def myfunc(x):
if isinstance(x,list):
print('list')
return sum(set(x))
if isinstance(x,tuple):
print('tuple')
res =1
for item in x:
res*=item
return res

print(myfunc((1,2,3,4)))
print(myfunc([1,2,3,4]))
L =[]

i =1
while i<=100:
L.append(i*i)
i+=1
print(len(L))
print (sum(L))
# Enter a code
L = ['Alice', 66, 'Bob', True, 'False', 100]
index =0
while index < 6:
if index %2!=0:
print(L[index])
index+=1
# Enter a code
sum = 0
n=0

while n<=1000:
n=n+1
if n%2==0:
sum+=n
else:
continue

print (sum)
# Enter a code
n=1
result = 1
while n<=10:
result *= n
n+=1
print (result)
# -*- coding:utf-8 -*-
# Enter a code
age = 19
if age >= 18:
print('adult {}'.format(age))
else:
print("未成年")
obj = 'AABCDEFGHHIJ'
print(obj[1:-3])
template = 'Life is {0}, you need {1}'
result = template.format('short',"Python")
print result

template = 'Life is {s}, you need {p}'
longitude='short'
language="Python"
result = template.format(s=longitude,p=language )
print result
spstr1,spstr2,spstr3 = '\',\"','\\,\\\\','\\n\\t'
print('special string: ',spstr1,spstr2,spstr3)
agr = 18
if agr < 3:
print('baby')
else:
if agr > 17:
print('adult')
else:
if agr > 7:
print('teenager')
else:
print('kid')

最新回答 / Elysia_s
外國網站本來就不好進,我也以為進不去,但是只是有一點卡,多等一下一般電腦就都能進去了,實在不行去百度查鏡像網站下載
num=0
sum=1
while num<=9:
num=num+1
sum=sum*num
print(sum)

最新回答 / g_stEOT7
錯了,or要改成and,否則字符型,整數,符點都返回none

最新回答 / 風沙戰場封殺
你應該在 for 循環完之后再輸出 B 和 C,而不是在第一次 if 判定之后就 return。所以最好這樣:<...code...>
寫程序看來數學的基礎概念必須明了切扎實。
課程須知
如果您了解程序設計的基本概念,會簡單使用命令行,了解中學數學函數的概念,那么對課程學習會有很大的幫助,讓您學起來得心應手,快速進入Python世界。
老師告訴你能學到什么?
通過本課程的學習,您將學會搭建基本的Python開發環境,以函數為基礎編寫完整的Python代碼,熟練掌握Python的基本數據類型以及list和dict的操作,靈活使用流程控制語句。

微信掃碼,參與3人拼團

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網的支持!

本次提問將花費2個積分

你的積分不足,無法發表

為什么扣積分?

本次提問將花費2個積分

繼續發表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消