-----------------------------------------
圖片放大特效
table樣式

<style scoped>
img[alt="Alt1"]{
background: rgba(255, 255, 255, 0);
position: absolute;
top: 10%;
left: 10%;
/* transform: translate(-50%, -50%); */
width: 200px; /* 調整圖片寬度 */
height: auto; /* 保持原始比例 */
padding:0;
margin:0;
z-index: 1;
}
img[alt="Alt2"]{
background: rgba(255, 255, 255, 0);
position: absolute;
top: 10%;
left: 75%;
/* transform: translate(-50%, -50%); */
width: 200px; /* 調整圖片寬度 */
height: auto; /* 保持原始比例 */
padding:0;
margin:0;
z-index: 2;
}
</style>
---
- **掌握Python基礎語法** - 學會用最簡潔的方式與電腦對話 💬
- **熟練輸入輸出操作** - 讓程式能夠聆聽你的聲音,也能回應你的需求 🎤➡️📢
- **創作ASCII藝術** - 用程式碼變身數位藝術家,畫出可愛的圖案 🎨
- **運用時間模組** - 讓你的程式活起來,會跳舞、會眨眼!⏰✨
- **整合實作能力** - 把所有技能組合起來,創造屬於自己的作品 🚀
#### 🧠 運算思維培養:
- **拆解(Decomposition)** - 把複雜的ASCII圖案拆成一行行的print指令
- **模式識別(Pattern Recognition)** - 發現重複的圖案結構和時間循環規律
- **抽象化(Abstraction)** - 把現實世界的時間概念轉換成程式邏輯
- **演算法設計(Algorithm Design)** - 設計步驟讓程式按順序執行,創造動畫效果
---
#### 會說話的小貓 💬
```python
def cute_cat():
print(" /\\_/\\ ")
print(" ( ^.^ ) ")
print(" > ♡ < ")
print(" /| |\\ ")
print(" (_|___|_) ")
print(" | | ")
print(" / \\ ")
print(" (_______) ")
print()
print(" ╭─────────────╮")
print(" │ 哈囉!我是 │")
print(" │ Python小貓 │")
print(" │ 🐾 喵~ │")
print(" ╰─────────────╯")
cute_cat()
```
---
## ASCII Arts

---
### 實作範例:小狗ASCII Art 🐶
```python
# 可愛小狗
dog_ascii = """
/ \\ / \\
( . .)
) (
( v )
^^ | ^^
WOOF!
"""
print("汪汪小狗:")
print(dog_ascii)
```
---
### 實作範例:房子ASCII Art 🏠
```python
house_ascii = """
/\\
/ \\
/____\\
| |
| [] |
| [] |
|______|
HOME
"""
print("溫馨小屋:")
print(house_ascii)
```
---
### 進階技巧:函數化ASCII圖案
```python
def display_ascii_art(art_name, ascii_content):
"""顯示ASCII藝術的函數"""
print(f"=== {art_name} ===")
print(ascii_content)
print("=" * 20)
# 使用函數顯示不同圖案
rocket = """
/\\
/ \\
| |
| ** |
/| |\\
/ |____| \\
/ ROCKET \\
^^^^^^^^^^
"""
display_ascii_art("火箭", rocket)
```
想要更複雜的ASCII圖案?可以使用線上工具:
---
### 實作練習:建立自己的ASCII圖案庫
```python
# ASCII圖案庫
ascii_library = {
"smile": """
😊
/|\\
|
/ \\
""",
"tree": """
🌲
/|\\
/ | \\
/ | \\
/___|___\\
|
|
""",
"star": """
⭐
/|\\
/ | \\
*--+--*
\\ | /
\\|/
*
"""
}
# 選擇要顯示的圖案
choice = input("選擇圖案 (smile/tree/star): ")
if choice in ascii_library:
print(ascii_library[choice])
else:
print("找不到該圖案!")
```