๐งช ๆไปถ่ฏปๅ
โฑ๏ธ 20-25 min๐ Intermediate
main.py
Costs 1 credit
ๅ ่ฝฝ็ผ่พๅจไธญ...
่พๅบ Outputๆง่กๆๅ
[้่ฏฏๆ็คบ] ๆฃๆตๅฐไธญๆๅ จ่ง็ฌฆๅท๏ผๅฆ ๏ผ ๏ผ ๏ผ ๏ผ ๏ผ๏ผ๏ผPython ่ฏญๆณๅฏ่ฝๆ ๆณ่งฃๆใ ่ฏทๆนๆ่ฑๆๅ่ง็ฌฆๅท๏ผ( ) , : ;
Terminal (Simulated)Install commands are simulated only, no real network requests
$
Step 1: ๆจกๆๆไปถๆไฝ
<p>ๅ
็จๅญ็ฌฆไธฒๆจกๆๆไปถ๏ผๆฏไธบไบๆๆณจๆๅๆพๅจโ่ฏปๅๆต็จโ่ไธๆฏ็ฏๅขๆ้ใ</p>
<div class="concept-block">
<strong>ๅบๅฑ้ป่พ๏ผ</strong><br/>
ๆไปถ่ฏปๅๆฌ่ดจๆฏๆๅญ่ๆต่ฝฌๆๆๆฌ่กใ<code>splitlines()</code> ๆจกๆ็ๅฐฑๆฏโๆ่กๅๅโ่ฟไธๆญฅใ
</div>
<p><strong>ไฝ ็ไปปๅก</strong>๏ผ</p>
<ol>
<li>ๅๅปบไธไธชๅ
ๅซๅค่กๆๆฌ็ๅญ็ฌฆไธฒ๏ผๆจกๆๆไปถๅ
ๅฎน๏ผ</li>
<li>ไฝฟ็จ <code>splitlines()</code> ๅๅฒๆ่ก</li>
<li>ๆๅฐๆฏไธ่ก</li>
</ol>
<p>็คบไพๅ
ๅฎน๏ผ</p>
<pre>Hello World
Python is fun File I/O is easy
Self-Check List
- ๆจกๆๆไปถๅ ๅฎน
- ๅๅฒ่ก
- ้ๅๆๅฐ
Transfer Template
file_content = """Hello World Python is fun File I/O is easy""" lines = file_content.splitlines()
After completing this step, you should be able to independently explain and reproduce this concept, then apply it to similar problems.