
爬虫
shebedo_
这个作者很懒,什么都没留下…
展开
-
爬虫 python基础知识(输入古诗复制古诗)
# -*- codeing = utf-8 -*-# @Time : 2021/2/11 0:31# @Author : foryou# @File : zuoye1.py# @Software: PyCharmimport osdef input_poem(): try: try: f = open("poem.txt", "w", encoding="utf-8") except Exception as result:原创 2021-02-11 01:11:36 · 1341 阅读 · 1 评论 -
爬虫 python基础练习(文件的读取)
# -*- codeing = utf-8 -*-# @Time : 2021/2/10 16:58# @Author : foryou# @File : demo7.py# @Software: PyCharm'''f=open("test.txt","w") #read方法,读取指定的字符,开始时指定在文件头部, # 每执行一次,向后移动指定字符数 #打开文件:w写模式 文件不存在就新建原创 2021-02-10 21:44:13 · 546 阅读 · 2 评论 -
爬虫 复习python基础知识(购物车)
products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]]print("-"*6+"\t"+"商品列表"+"\t"+"-"*6)for i in range(6): print(i,end=" ") for j in range(2): #suojin= print(products[i][j],end="")原创 2021-02-10 02:08:43 · 352 阅读 · 1 评论 -
爬虫 复习python基础知识(老师分教室)
import randomclassroom = [[],[],[]]teachers = ["A","B","C","D","E","F","G","H"]for teacher in teachers: classroom[random.randint(0,2)].append(teacher)for i in range(3): print("第%d个教室有%d个人"%(i+1,len(classroom[i]))) for j in range(len(classro原创 2021-02-10 01:24:08 · 187 阅读 · 0 评论 -
爬虫 复习python基础知识(九九乘法表)
for i in range(1,10): for j in range(1,i+1): print("%d*%d=%d"%(i,j,i*j),end=" ") print("\n")![结果原创 2021-02-10 00:06:43 · 408 阅读 · 0 评论 -
爬虫 复习python基础知识(石头剪刀布)
实现功能:用户输入石头剪刀布与电脑进行猜拳,当用户输入格式错误时要求用户重新输入,直至输入正确格式,此时进行判断胜负import randomwhile True: com=["石头","剪刀","布"] x = random.randint(0,2) YongHu=input("请你出拳(石头,剪刀,布):") if (YongHu == "石头")or(YongHu == "剪刀")or(YongHu == "布"): print("你的出拳为%s"原创 2021-02-09 16:46:52 · 237 阅读 · 0 评论