---
# System prepended metadata

title: Python Ch6-2
tags: [python2021]

---

# Python Ch6-2
###### tags: `python2021`
* 要求 (request)：
    * 格式請依照ex1的標準 (檔名:ex7-1.py, ex7-2.py...，最後將所有檔案壓縮至學號.zip or 學號.7z上傳e3)
    * 輸出檔案內容以TA截圖為標準

# Question 1 : Function for return median
Please write a function that takes a list to calculate and return its medium. Use the following assertions to test your function:

```python=
def my_median(numbers):
    #write something


numbers = [50.9, 50.3, 48.7, 89.2, 60.0, 74.0, 54.2, 101.6, 84.9, 82.1, 79.4, 93.8]
assert my_median(numbers) == 76.7
```
:::info
Hint:
This time, use "if" and "else" to solve this question.

:::

# Question 2 : handle GC content
Print out the GC content of the sequence which its GC content value is less than 0.6 and more than 0.5.
The output should include the sequence and its GC content.

```python

seq_list=["ATATGGTAGGGCACACACGGGAGGAGAAATATAGAGAACACACACACACACACATC",
          "ATATATAGGGCACACACGGGAGGAGAAATATAGAGAACACACGCCCCCACACACATG",
          "ATATATCCGCACACACGGGAGGAGAAATATAGAGAACACACACACACACACATH",
          "ATATATAGGGCACACACGGGAGGAGAGCGCGCGAGAGAACACACACACACACACATA",
          "ATAAGGGATAGGGCACACACGGGAGGAGAAATATAGAGAACACACGCGGCACACATA",
          "ATAAGGGATAGGGCACACACGGGAGGAGAAATATAGAGAACGGGGGGGGGGGCCCCCCACACGCGGCACACATA",
          "ATAAGGGATAGGGCACACACGGGAGGAGAAATATAGAGAACACACGCGGCACACAGCGCGCGCGCGGCTA",
          "ATAAGGGATAGGGCACACACGGGAGGAGAAATATAGAGAGGGGGGGGGCCCCCCCCCCCCCACACACGCGGCACACATA",
          "GCCCCCCCCCCCCCCCCCCCCCCGGGGGGGGGGGGGGGGGGGGGGGGG"]

```
![](https://i.imgur.com/MkFPN3d.jpg)



# Question 3 : money is all
Use for loop to print the triangle of dollar sign, human and pound sign(井字號). 
The level of triangle should be controlled by **input()**.


![](https://i.imgur.com/eTjfeYA.jpg)

