写出下面程序的运行结果。t1=("zhangsan",18,95.5)t2=()t3=(33,)t4=([44,55,66])t5=t1+t3print(t1,t2,t3,t4,t5)print(t5)print(max(t4))print(min(t4))
查看答案
写出下面程序的运行结果。ls=[1,2,3,2,3,4]print(ls.index(4))print(ls.count(3))print(max(ls))print(min(ls))print(len(ls))del ls[3]print(ls)ls.sort(reverse=True)print(ls)
写出下面程序的运行结果。import copys1=[4,5,6]s2=s1s2[1]="nk"print(s1,s2)s3=s1[1:3]s3[1]="cn"print(s1,s3)s4=copy.deepcopy(s1)s4[1]=333print(s1,s4)s5=[4,[5,6]]s6=s5[1:3]s5[1][0]="cn"print(s5,s6)s7=copy.deepcopy(s5)s7[1]="nk"print(s5,s7)
写出下面程序的运行结果。s1={1,2,3}s2=set([2,3,3,4])s1.add(3)s2.update('ab')s3=s1.intersection(s2)s4=s1.union(s2)s5=s1.difference(s2)s6=s1.symmetric_difference(s2)print(s1)print(s2)print(s3)print(s4)print(s5)print(s6)
写出下面程序的运行结果。d1={'name':"zhangsan",'sno':"001",'score':99}d2=dict().fromkeys(['radius','height'],0)print(d1)print(d2)d1.update({'age':19})d2.update(radius=10)print(d1)print(d2)del d1['age']height=d2.pop('height','not found')print(d1)print(d2)print(height)print(len(d1))print(len(d2))