Test Your Knowledge: Quiz

 

 
  1. Consider the following three statements. Do they change the value printed for A?

    A = "spam"
    B = A
    B = "shrubbery"

    广告:个人专属 VPN,独立 IP,无限流量,多机房切换,还可以屏蔽广告和恶意软件,每月最低仅 5 美元

  2. Consider these three statements. Do they change the printed value of A?

    A = ["spam"]
    B = A
    B[0] = "shrubbery"

  3. How about these—is A changed now?

    A = ["spam"]
    B = A[:]
    B[0] = "shrubbery"