Python practice

来源:互联网 发布:不闷痘的防晒霜 知乎 编辑:程序博客网 时间:2024/06/02 02:16


Today, I try to use the modules in Python, and downloaded some popular modules. The BeautifulSoup and Requests..


And I start to write more advanced program with data structure. I tried the que in the module "deque".


from collections import dequenum = deque([])def insert(val):    if len(num) == 0:        num.append(val)        return    if val > num[len(num) - 1]:        num.append(val)        return    for j in range(len(num)):        if num[j] >= val:            break    num.insert(j, val)tot = int(input("the number of num :\n"))for i in range(tot):    insert(int(input()))for i in range(tot):    print(num.popleft())


I search for the ants program on the Internet these days, and I found some points I need to get through later on.

1. threading work.
2. regular expression.
3. JASON and BSON.

Hope I can write an ant in the very soon.