Toggle navigation
HUSTOJ
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Language
中文
ئۇيغۇرچە
English
فارسی
ไทย
한국어
Problem D: python-for循环语句的使用
Problem D: python-for循环语句的使用
[Creator :
]
Time Limit :
1.000
sec
Memory Limit :
128 MB
Solved: 7
Submit: 7
Statistics
Description
1、for循环语句格式:
for <循环变量> in <循环序列>:
循环体(语句组)
2、执行过程
例1:for i in ['烧鸡','烧鸭','猪蹄','鸭脖']:
print('我喜欢吃:' , i )
运行结果:
我喜欢吃: 烧鸡
我喜欢吃: 烧鸭
我喜欢吃: 猪蹄
我喜欢吃: 鸭脖
任务一:请参考例1中for循环语句的使用,编程实现用for循环语句输出1到10。
Input
无
Output
1
2
3
4
5
6
7
8
9
10
Sample Input
Copy
无
Sample Output
Copy
1 2 3 4 5 6 7 8 9 10