๐งช ๅพช็ฏ่ฏญๅฅ
โฑ๏ธ 20-25 min๐ Beginner
main.py
Costs 1 credit
ๅ ่ฝฝ็ผ่พๅจไธญ...
่พๅบ Outputๆง่กๆๅ
# ่ฟ่กไปฃ็ ๅ๏ผ่พๅบๅฐๆพ็คบๅจ่ฟ้ # ๆ Ctrl+Enter ๅฟซ้่ฟ่ก
Terminal (Simulated)Install commands are simulated only, no real network requests
$
Step 1: for ๅพช็ฏๅบ็ก
for ๅพช็ฏๆฏโ้ไธชๅค็ๆฐๆฎ้ๅโ็้ฆ้ๅทฅๅ ท๏ผ้ๅๅ่กจใๅญ็ฌฆไธฒใๅญๅ ธ็ญๅฏ่ฟญไปฃๅฏน่ฑกใ
ๅบๅฑ้ป่พ๏ผ
ๆฏ่ฝฎๆง่กๅไธๆฎตไปฃ็ ๏ผๅฎ็ฐโ็ธๅๅค็ๅบ็จๅฐไธๅๆฐๆฎโใ
for x in sequence ไผ่ฎฉๅ้ x ไพๆฌก็ปๅฎๅฐๅบๅไธญ็ๆฏไธชๅ
็ด ใๆฏ่ฝฎๆง่กๅไธๆฎตไปฃ็ ๏ผๅฎ็ฐโ็ธๅๅค็ๅบ็จๅฐไธๅๆฐๆฎโใ
ๅ็นๅ๏ผๅๅ้ๆฏไธชไบบ้ฝไผ่ขซๅซๅฐไธๆฌก๏ผๆฏๅซๅฐไธไธชๅฐฑๆง่กๅๆ ทๅจไฝ๏ผๆๅฐ๏ผใ
ไฝ ็ไปปๅก๏ผ
- ๅๅปบๅ่กจ
fruits = ["apple", "banana", "cherry"] - ไฝฟ็จ for ๅพช็ฏ่พๅบๆฏไธชๆฐดๆ
Self-Check List
- ไฝฟ็จ for ๅพช็ฏ้ๅๅ่กจ
Transfer Template
for fruit in fruits:
print(fruit)After completing this step, you should be able to independently explain and reproduce this concept, then apply it to similar problems.