---
# System prepended metadata

title: 2019/09/24

---

# 2019/09/24
- ## 寫下如何完成Big File 這題CTF
````
from bs4 import BeautifulSoup
import requests
r = requests.Session()
index = r.get('http://140.134.25.138:10012/index.php')
    while True:
        soup = BeautifulSoup(index.text,"html.parser")
        token = soup.find('input')['value']
        print(token)
        data = {'token' : token}
        index = r.post('http://140.134.25.138:10012/index.php',data = data)
        soup = BeautifulSoup(index.text,"html.parser")
        flag = soup.find('h1',{'name':'flag'}).text
        print flag
        if(flag!="CTF{NOT_THIS_ONE}"):
            print 'stop'
            exit()
````        
- ## 簡述 mv ./a ./b 這行指令意義
     如果沒有命名為b的資料夾，則將a檔案重新命名為b，如果有b資料夾，則將a檔案移動到b資料夾裡。
- ## 使用Python 印出菱形並截圖4~6顆*的輸出成果
````
rows = input()
i = j = k = 1
for i in range(rows):
    for j in range (rows - i):
        print " ",
        j += 1
    for k in range (2 * i - 1):
        print "*",
        k += 1
    print "\n"
    i += 1
for i in range(rows):
    for j in range (i):
        print " ",
    for k in range (2 * (rows - i) - 1):
        print "*",
    print "\n"
    i += 1
````
![](https://i.imgur.com/W7lQNNH.png)
- ## 使用Python 印出並截圖4~6顆*的輸出成果
````
rows = input()
i = j = k = 1
for i in range(0,rows):
    for k in range (0,rows-i):
        print "*",
    print "\n"
for i in range(0,rows):
    for k in range(0,rows-i):
        print " ",
    for j in range(0,i+1):
        print "*",
    print "\n"
````
![](https://i.imgur.com/WopeC6g.png)
- ## 寫一個 Python Function輸入 200 輸出 2*100 輸入 123 輸出 1*100+2*10+3*1 請附程式碼，並給10個輸入，並截圖輸出結果
````
while(1)
    num = input()
    i=j=k=0
    i=num%10
    j=(num-i)/10%10
    k=(num-i-10*j)/100%10

    if(k!=0):
        k=str(k)+"*"+"100"
        print k,
        if(j!=0 or i!=0):
            print "+",
    if(j!=0):
        j=str(j)+"*"+"10"
        print j,
        if(i!=0):
            print "+",
    if(i!=0):
        i=str(i)+"*"+"1"
        print i
````
![](https://i.imgur.com/DPdaiaU.png)
