a = [20,40,50] a.append(60) a = a+[80] b = [12,13,14] a.extend(b) a.insert(2,123) a.remove(50) a.pop(123) print(a)
a = [,,] a.append() a = a+[] b = [,,] a.extend(b) a.insert(,) a.remove() a.pop() (a)
为什么这里会报错啊pop和remove改怎么用,然后为什么没有del
假如我要存金币写成
jinbi=100
标识符直接写成相关文字拼音应该也是可以的吧
老师 ,使用setter装饰器的话,在传入参数时只可以传入一个参数吗?想传入多个参数时报错,可以传入多个参数吗?
import time time1 = time.time() a = "" for i in range(1000000): a += "sxt" time2 = time.time() print("+加连接的运算时间:"+str(time2-time1)) time3 = time.time() li = [] for i in range(1000000): li.append("sxt") b = "".join(li) time4 = time.time() print("join()连接时间: "+str(time4-time3))
运行不了,他说我第6行代码错误
a=3 print(id(a)) 这个输出的id是值3的id吧?
你好請問如何可以開字幕呀?上一個影片有
老师,这个代码迟迟不反应是正常情况吗
a=3 print(a) print(id(a)) print(type(a)) b="love" print(b) print(id(b)) print(type(b))
import turtle #第一个圈 turtle.width(10) turtle.color("blue") turtle.circle(50) #第二个圈 turtle.penup() turtle.goto(80,0) turtle.pendown() turtle.color("black") turtle.circle(50) #第三个圈 turtle.penup() turtle.goto(160,0) turtle.pendown() turtle.color("red") turtle.circle(50) #第四个圈 turtle.penup() turtle.goto(40,-60) turtle.pendown() turtle.color("yelow") turtle.circle(50) #第五个圈 turtle.penup() turtle.goto(100,-60) turtle.pendown() turtle.color("green") turtle.circle(50) turtle.done
练习的时候总是会漏掉turtle.color 运行出错后又马上修改
請問為什麼不可以用 .replace 而要用sio呢?
score = int(input("请输入该同学分数:")) degree = 'ABCDE' num = 0 if score<0 or score>100: score = int(input("数字太大,请重新输入:")) else: num = score//10 if num<6: num=5 print("分数是:{0},等级是:{1}".format(score,degree[9-num]))
老师,为什么我第一次输入一个大于100的数字之后,第二次输入小于100的数字会显示字符串索引超出范围的错误啊,我没看出问题啊
import io s = "hello, sxt" sio = io.StringIO(s) #可变字符串 print(sio) v1 = sio.getvalue() print("v1:",v1) char7 = sio.seek(7) #指针知道索引7这个位置 print(sio.seek(7)) sio.write("gaoqi") v2 = sio.getvalue() print("v2:",v2)
这个sio.seek()是什么 为什么赋值或者不赋值都能正常运行
你好請問在畫turtle的同時python的所有其他功能也是可以用的嗎?就是把它當成平時python一樣就可以嗎?因為用turtle的時候感覺就像在用另一個語言似的
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637