QuestionQ7

Python Basics

What does the variable x contain after the following commands run in a Python interactive session?

Question Image

  • A 'So'
  • B 'So you'
  • C 'So you want a GIAC Certification?'
  • D 'So', 'you'
Explanation

Evaluating an expression without assigning its result does not modify the variable that supplied the value. The expression indexes into a value derived from x, but x remains bound to its original string, so printing it displays the complete original text.

Community Discussion

No comments yet. Be the first to start the discussion!