課程
/后端開發
/Python
/初識Python
for x in [ 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*10 + y
2016-07-31
源自:初識Python 5-8
正在回答
for x in [ 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: #Hhhhh,要注意縮進哦~o(* ̄▽ ̄*)ブ??????????? print x*10 + y
雨落平生 提問者
? ? ? ? ? ? print x*10 + y
應該是格式問題,嚴格按照空4格的要求。以下是執行后的
Type "copyright", "credits" or "license()" for more information.
>>> for x in [ 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 10*x+y
12
13
14
15
16
17
18
19
23
24
25
26
27
28
29
34
35
36
37
38
舉報
學python入門視頻教程,讓你快速入門并能編寫簡單的Python程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-07-31
for x in [ 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: #Hhhhh,要注意縮進哦~o(* ̄▽ ̄*)ブ
??????????? print x*10 + y
2016-07-31
for x in [ 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*10 + y
應該是格式問題,嚴格按照空4格的要求。以下是執行后的
Type "copyright", "credits" or "license()" for more information.
>>> for x in [ 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 10*x+y
12
13
14
15
16
17
18
19
23
24
25
26
27
28
29
34
35
36
37
38