python
python基础整理
江南又旧雨
踏踏实实,简简单单,实实在在,做好当前,做好每一天!低头走路,莫问前程。
展开
-
Python_任意进制间互相转换
#!/usr/bin/python3 def any_to_dec(num_type, num_str): num_type = int(num_type) print("输入的",num_type,"进制数是:",num_str) i = 0; num = 0; num_str = num_str[::-1] dict1={'1':1,'...原创 2020-02-17 19:24:51 · 397 阅读 · 0 评论 -
Pyhton猜数小游戏
print(""" 这是一个猜数游戏, 请猜一个0--10之间的数。 """) game_type = input(""" 请输入游戏次数, 无限次游戏请输入forever, n次游戏请输入n。 n:""") if game_type == "forever" : print("无限次游戏模式") else : game_type = int(game_type) ...原创 2020-02-17 19:19:47 · 152 阅读 · 0 评论 -
Python3_简单的爬虫程序实现电子词典
import urllib.request import urllib.parse import json url = "http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule" head ={} head['Referer']="http://fanyi.youdao.com/?keyfrom=fanyi....原创 2020-02-17 19:16:18 · 283 阅读 · 0 评论