Thursday , September 19 2024

Which of the following variable names are illegal and will cause the SyntaxError exception? (Select two answers)

Questions BankCategory: Python Essentials 1Which of the following variable names are illegal and will cause the SyntaxError exception? (Select two answers)
Which of the following variable names are illegal and will cause the SyntaxError exception? (Select two answers)

  • for
  • print
  • in
  • In

Explanation: The in and for names are Python reserved words (keywords). These cannot be used as variable names. Note that the name print is not a Python reserved word and can be used as a variable name, in which case it will shadow the Python built-in function, print().

More Questions: Python Essentials 1 (PE1) Course Final Test