l = [1, 2, 3, 4, 5]; del l[2:4]; 则运算之后 l 为[1,2, 3] 。 basket = ['apple', 'banana', 'apple', 'orange'] ;fruit = set(basket);fruit2 = set(['apple', 'melo']); len(fruit |fruit2) 的结果是 5。 basket = ['apple', 'banana', 'apple', 'orange'] ;fruit = set(basket); len(fruit) 的运算结果是 4。 l = [2, 1, 3, 5, 4]; l.remove(3); l.sort(); 则运算之后l 为[1, 2, 4, 5]
Private Sub Command1_Click() Dim myfrt As fruit myfr orange = 5 myfr apple = 10 Open “c:/myfrt txt” For Output As #1 Print #1, myfr orange; myfr apple Close #1 End Sub Private Sub Command1_Click() Dim myfrt As fruit myfr orange= 5 myfr apple= 10 Open “c:/myfrta txt”For Input As #1 Print #1, myfrt, orange; myfr apple Close #1 End Sub Private Sub Command1_Click() Dim myfrt As fruit myfr orange= 5 myfr apple = 10 Open “c:/myfrta txt” For As #1 Print #1, myfr orange; myfr apple Close #1 End Sub Private Sub Command1_Click() Dim myfrt As fruit myfr orange = 5 myfr apple= 10 Open “c:/myfrta.txt” For Output As #1 Print myfr orange; myfr apple Close #1 End Sub