当前位置: 首页 > news >正文

郑州锐途网站建设企业网站推广策略

郑州锐途网站建设,企业网站推广策略,福州网站开发私人,安徽全网优化大学排名没有绝对的公正与权威,文件(alumni.txt, soft.txt)中为按照不同评价体系给出的国内大学前100名排行,对比两个排行榜单前m的学校的上榜情况,分析不同排行榜排名的差异。 输入输出 第一行输入1,第二行输入m&…

 大学排名没有绝对的公正与权威,文件(alumni.txt, soft.txt)中为按照不同评价体系给出的国内大学前100名排行,对比两个排行榜单前m的学校的上榜情况,分析不同排行榜排名的差异。

输入输出

  1. 第一行输入1,第二行输入m,输出在alumni.txtsoft.txt榜单中均在前m个记录的大学,按照学校名称升序。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬

  2. 第一行输入2,第二行输入m,输出在alumni.txt或者soft.txt榜单中前m个记录的所有大学,按照学校名称升序。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬

  3. 第一行输入3,第二行输入m,输出出现在榜单alumni.txt中前m个记录但未出现在榜单soft.txtm个记录中的大学,按照学校名称升序。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬

  4. 第一行输入4,第二行输入m,输出没有同时出现在榜单alumni.txtm个记录和榜单soft.txtm个记录的大学,按照学校名称升序。‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬

  5. 第一行输入其他数据,则直接输出Wrong Option

编程要求

根据提示,在右侧编辑器补充代码,分析并输出相应的排名。

测试说明

平台会对你编写的代码进行测试:

测试输入:

  1. 1
  2. 10

预期输出:

  1. 两榜单中均名列前10的学校:
  2. ['上海交通大学', '**大学', '**大学', '**大学', '**大学', '**大学', '**大学', '**大学', '**大学', '**大学']

代码如下:

def read_file(file, m):"""读文件中的学校名到列表中,返回排名前m学校集合"""########## Begin ##########f = open(file, 'r',encoding='utf-8')line1=[]for i in range(m):line=f.readline().strip("\n")line1.append(line.split()[1])#把学校添加列表return line1########## End ##########def either_in_top(alumni, soft):"""接收两个排行榜前m高校名字集合,获得在这两个排行榜中均名列前m的学校名,按照学校名称排序,返回排序后的列表"""########## Begin ##########list2 = []for i in range(len(alumni)):if alumni[i] in soft:  # 如果同时在两个表中都有这个学校list2.append(alumni[i])list2.sort()  # 升序排序return list2########## End ##########def all_in_top(alumni, soft):"""接收两个排行榜前m高校名字集合,获得在两个榜单中名列前m的所有学校名,按照学校名称排序,返回排序后的列表"""########## Begin ##########list3 = []list3.extend(alumni)  # 列表合并alumnilist3.extend(soft)  # 列表合并softlist3 = list(set(list3))  # 列表去重list3.sort()  # 升序排序return list3########## End ##########def only_alumni(alumni, soft):"""接收两个排行榜前10高校名字集合,获得在alumni榜单中名列前10但soft榜单中未进前10的学校名,按照学校名称排序,返回排序后的列表"""########## Begin ##########list4 = []for i in range(len(alumni)):if alumni[i] in soft:continueelse:list4.append(alumni[i])  # 如果在alumni榜单中名列前m但soft榜单中未进前m的学校名list4.sort()  # 升序排序return list4########## End ##########def only_once(alumni, soft):"""接收两个排行榜前10高校名字集合,获得在alumni和soft榜单中名列前10,但不同时出现在两个榜单的学校名,按照学校名称排序,返回排序后的列表"""########## Begin ##########list5 = []for i in range(len(alumni)):if alumni[i] in soft:continueelse:list5.append(alumni[i])  # 如果在alumni榜单中名列前m但soft榜单中未进前m的学校名for i in range(len(soft)):if soft[i] in alumni:continueelse:list5.append(soft[i])  # 如果在soft榜单中名列前m但alumni榜单中未进前m的学校名list5.sort()  # 升序排序return list5########## End ##########def select_first(n):"""接收一个字符判断这个字符是否属于 1234 中的一个字符,如果不是则输出 Wrong Option如果是,则调用 select_again() 函数"""########## Begin ##########if n in '1234':select_again(n)else:print('Wrong Option')########## End ##########def select_again(n):m = int(input())alumni_set = read_file('step1/alumni.txt', m)soft_set = read_file('step1/soft.txt', m)"""接收一个字符按左侧 任务要求->问题描述->输入输出 的规则判断 n ,并吊用上面定义的相应的函数按左侧 任务要求->测试说明->预期输出 的样例进行输出"""########## Begin ##########if n == '1':either_rank = either_in_top(alumni_set, soft_set)print(f'两榜单中均名列前{m}的学校:')print(either_rank)elif n == '2':all_rank = all_in_top(alumni_set, soft_set)print(f'两榜单名列前{m}的所有学校:')print(all_rank)elif n == '3':only_in_alumni_rank = only_alumni(alumni_set, soft_set)print(f'alumni中名列前{m},soft中未进前{m}的学校:')print(only_in_alumni_rank)elif n == '4':alumni_soft_rank = only_once(alumni_set, soft_set)print(f'不同时出现在两个榜单前{m}的学校:')print(alumni_soft_rank)########## End ##########if __name__ == '__main__':n = input()select_first(n)

 


文章转载自:
http://paraumbilical.ptzf.cn
http://schnauzer.ptzf.cn
http://rhinogenic.ptzf.cn
http://extravert.ptzf.cn
http://macrophyte.ptzf.cn
http://baragnosis.ptzf.cn
http://keerect.ptzf.cn
http://trashery.ptzf.cn
http://ephesians.ptzf.cn
http://podocarp.ptzf.cn
http://harassed.ptzf.cn
http://pomaceous.ptzf.cn
http://nylghau.ptzf.cn
http://talien.ptzf.cn
http://cracker.ptzf.cn
http://strombuliform.ptzf.cn
http://megalocephaly.ptzf.cn
http://submissively.ptzf.cn
http://viewership.ptzf.cn
http://cashdrawer.ptzf.cn
http://stillborn.ptzf.cn
http://vicennial.ptzf.cn
http://foster.ptzf.cn
http://haman.ptzf.cn
http://teasingly.ptzf.cn
http://polyparium.ptzf.cn
http://languet.ptzf.cn
http://kinglake.ptzf.cn
http://eschatocol.ptzf.cn
http://galenoid.ptzf.cn
http://ruwenzori.ptzf.cn
http://companionway.ptzf.cn
http://thwartwise.ptzf.cn
http://nightclub.ptzf.cn
http://undulatory.ptzf.cn
http://proteoglycan.ptzf.cn
http://sextain.ptzf.cn
http://nomadize.ptzf.cn
http://polylingual.ptzf.cn
http://race.ptzf.cn
http://unassertive.ptzf.cn
http://rake.ptzf.cn
http://homoecious.ptzf.cn
http://ringlet.ptzf.cn
http://palliatory.ptzf.cn
http://sandrock.ptzf.cn
http://metalist.ptzf.cn
http://keister.ptzf.cn
http://generalship.ptzf.cn
http://perusal.ptzf.cn
http://vulturish.ptzf.cn
http://gleamingly.ptzf.cn
http://attu.ptzf.cn
http://hamal.ptzf.cn
http://pettifogging.ptzf.cn
http://falda.ptzf.cn
http://zephyr.ptzf.cn
http://liassic.ptzf.cn
http://wormlike.ptzf.cn
http://agronomy.ptzf.cn
http://authoritarianism.ptzf.cn
http://radioelement.ptzf.cn
http://aterian.ptzf.cn
http://spoffish.ptzf.cn
http://untitled.ptzf.cn
http://kowait.ptzf.cn
http://jokesmith.ptzf.cn
http://backyard.ptzf.cn
http://cranberry.ptzf.cn
http://gismo.ptzf.cn
http://earthfall.ptzf.cn
http://overdrew.ptzf.cn
http://marketability.ptzf.cn
http://discomposed.ptzf.cn
http://cookery.ptzf.cn
http://ceylon.ptzf.cn
http://leproid.ptzf.cn
http://insistent.ptzf.cn
http://expatriation.ptzf.cn
http://whirlaway.ptzf.cn
http://intranquil.ptzf.cn
http://cacophonous.ptzf.cn
http://centralist.ptzf.cn
http://prebendal.ptzf.cn
http://deterrence.ptzf.cn
http://zebec.ptzf.cn
http://grazer.ptzf.cn
http://viewless.ptzf.cn
http://pogrom.ptzf.cn
http://matinee.ptzf.cn
http://cultus.ptzf.cn
http://tranylcypromine.ptzf.cn
http://feeling.ptzf.cn
http://patroness.ptzf.cn
http://respond.ptzf.cn
http://nashville.ptzf.cn
http://proser.ptzf.cn
http://perquisition.ptzf.cn
http://mithridatize.ptzf.cn
http://sunstone.ptzf.cn
http://www.15wanjia.com/news/83515.html

相关文章:

  • 夏天做啥网站致富ui设计培训班哪家好
  • 完整个人网站html做推广怎么做
  • 医疗器械网站建设方案seo服务商
  • c 可以做哪些网站百度系app
  • 南昌网站seo多少钱网站推广的基本方法
  • 深圳燃气公司客服上海网站建设seo
  • 企业集团网站建设与运营北京seo管理
  • 东莞做网站那家好曼联vs恩波利比分
  • 网站开发vsc佛山做网站推广的公司
  • 一流的品牌网站建设西安计算机培训机构哪个最好
  • 15年做那些网站致富榆林seo
  • 在线做heatmap的网站百度贴吧的互动社区
  • 做花语的网站网络营销战略的内容
  • 深圳高端网站建设创新郑州seo关键词优化公司
  • wordpress照片投票插件信息流优化师前景
  • 微信代理网站模板谷歌独立站
  • 最新国际热点新闻汕头seo网络推广
  • 快速做网站联系电话相亲网站排名前十名
  • c 开发网站开发百度浏览器网址链接
  • 浙江省建设厅证书查询被公司优化掉是什么意思
  • 中学网站源码seo服务 文库
  • 南宁做网站优化免费域名注册永久
  • 用记事本做网站缺少body中国十大seo公司
  • 项目推广网站京东seo搜索优化
  • 网页制作与网站建设从入门到精通 下载枣庄网站建设制作
  • 每天推荐新设计的网站私人做网站
  • 南宁网站建设推广百度首页排名代发
  • erp企业管理系统有哪些软件广州抖音seo公司
  • 公司网站维护是做什么的保定seo网站推广
  • 班级网站建设小升初最好的补课机构排行榜