• 2022-06-17
    下列代码的输出结果是(_____)。 class Account: def __init__(self,id): self.id=id id=888 acc=Account(100) print(acc.id)
  • 100

    内容

    • 0

      以下程序段的输出结果是(  )。 id='370211200101018956' t=(id[6:10], id[10:12], id[12:14]) date='-'.join(t) print(date)

    • 1

      Opening an account with ID card at ATM.

    • 2

      已知id(ls1) = 4404896968,以下程序的输出结果是: ls1 = [1,2,3,4,5] ls2 = ls1 ls3 = ls1.copy() print(id(ls2),id(ls3))

    • 3

      ‎下列程序的输出结果是( )。​‎class Fruit():​‎ def __init__(self):​‎ print('Fruit')​‎ def grow(self):​‎ print('Fruit grow')​‎​‎class Vegetable():​‎ def __init__(self):​‎ print('Vegetable')​‎ def grow(self):​‎ print('Vegetable grow')​‎ ​‎class Tomato(Fruit,Vegetable):​‎ pass​‎​‎t = Tomato()​‎t.grow()​‎​‎知识点:多继承​ A: FruitFruit grow B: FruitVegetable grow C: VegetableFruit grow D: VegetableVegetable grow

    • 4

      class Person: def __init__(self,n="xxx"): self.name=n class Student(Person): def __init__(self,s="male"): self.sex=s def show(self): print(self.name,self.sex) s=Student("female") s.show() 结果: