题目内容

补充程序,采用字符串方式打印可以动态变化的文本进度条,进度条需要能在一行中逐渐变化。 import timescale=50start=time.perf_counter()print("执行开始".center(scale//2,'-'))for i in range(scale+1): a="*"*i b='.'*(100-i) c=i/100*100 t=______ -start print("\r{:^3.0f}%[{}->{}]{:.2f}s".format(c,a,b,t),end='') time.sleep(0.1)print("\n"+"执行结束".center(scale//2,'-'))

查看答案
更多问题

补充程序,编程实现输出txt文本所有可能的分词结果。import jiebatxt = "中华人民共和国万岁!"ls = ______ (txt, cut_all=True).print(ls)

补充程序,编写“石头‘,’剪刀‘,’布’游戏,电脑随机选择“石头”、“剪刀”或者“布”,用户循环输入“石头”、“剪刀”或者“布”,如果赢了,则输出“你赢了,恭喜!”,并结束游戏。输入格式随机数种子设置为0‪‪‪‪‪‪‫‪‪‪‪‪‪‪‪‪‪‪‫‪‪‪‪‪‫‪‪‪‪‪‫‪‪‪‪‪‪。‪‪‪‪‪‪‫‪‪‪‪‪‪‪‪‪‪‪‫‪‪‪‪‪‫‪‪‪‪‪‫‪‪‪‪‪‪‫import randomrandom.seed(0)list1 = ['石头','剪刀','布']tag = 1 while tag: people = input("猜拳游戏:请输入石头、剪刀或布:") computer = ______ if people == computer: print('平局,再来!') elif(people == '石头' and computer == '剪刀') or (people == '剪刀' and computer == '布') or (people == '布' and computer == '石头'): print('你赢了,恭喜! ') tag = 0 else: print('你输了,哈哈哈哈!')

补充程序,实现如下函数返回两个数的平方和。 def psum(a, b): ______ a**2 + b**2a=eval(input())b=eval(input())print(psum(a,b))

补充程序,实现用户登陆问题:用户名和密码都是”abc123”,如果用户三次没输对,则输出“invalid username or password!”,如果输入正确的用户名和密码,则输出“welcome abc123”。_user="abc123"_passwd="abc123"for i in range(3): username=input("请输入用户名:") password=input("请输入密码:") if username==_user and password==_passwd: print("welcome {}".______ ) breakelse: print("invalid username or password!")

答案查题题库