摘要:
import osimport re#获取本机用户名,构建student.txt文件名创建在左面import getpassusername=getpass.getuser()print("当前登录用户名"+username)filename="student.txt"filename="C:\\U 阅读全文
摘要:
import requestsfrom bs4 import BeautifulSoupdef get_movies(): headers={ 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KH 阅读全文
摘要:
def myfun(): num1 = int(input('输入num1')) num2 = int(input('输入num2')) list1=[] for i in range(1, max(num1, num2)): if num1 % i == 0 and num2 % i == 0: 阅读全文
摘要:
#字符串处理统计类型def my_func(*str): list_num = [] list_big = [] list_small = [] list_qt = [] str = input('请输入一个字符串') for j in str: elif ord(j) > 47 and ord(j 阅读全文
摘要:
import osdef alldir(path): stack=[] stack.append(path) while len(stack)!=0: dirpath=stack.pop() filelist=os.listdir(dirpath) for filename in filelist: 阅读全文
摘要:
#今天模仿前锋教育视频写的,感觉很实用。import osdef alldir(path,sp=''): file_list=os.listdir(path) # print(file_list) sp+='***' for file_name in file_list: file_abs=os.p 阅读全文
摘要:
#练习#程序购物车#启动程序后,让用户输入工资, 然后打印商品列表,允许用户根据商品编号购买商品用户选择商品后 #检测余额是否够,够就直接扣款,不够就提醒可随时退出,退出时,打印已购买商品和余额 commdity_dict={ '1':{'led电视':2000}, '2':{'24寸显示器':10 阅读全文