请教各位python同学第003讲课后作业
>>> myteacher = '小甲鱼'>>> yourteacher = myteacher
>>> myteacher = '黑夜'
>>> print(yourteacher)
为什么打印出来是小甲鱼?谢谢各位同学! 需要再赋值一次yourteacher = myteacher Gofoyi 发表于 2020-9-16 09:44
需要再赋值一次yourteacher = myteacher
就那些代码,打印出来的结果是小甲鱼。
没有再赋值。 myteacher = '小甲鱼'
yourteacher = myteacher
到这里,yourteacher和myteacher一样,都等于小甲鱼
然后
myteacher = '黑夜'
对myteacher重新赋值黑夜,因为这一语句在 yourteacher = myteacher之后,所以对 yourteacher毫无影响
打印结果当然是小甲鱼啦 昨非 发表于 2020-9-16 09:51
到这里,yourteacher和myteacher一样,都等于小甲鱼
然后
感谢!受教了 onec 发表于 2020-9-16 10:01
感谢!受教了
客气了
页:
[1]