GIAC Foundational Cybersecurity Technologies Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the GIAC Foundational Cybersecurity Technologies Test with interactive quizzes. Use flashcards and multiple choice questions with hints and detailed explanations. Ace your exam with confidence!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


In Python, which symbol indicates the text after it is a comment?

  1. #

  2. ;

  3. !

  4. --

The correct answer is: #

In Python, the symbol that indicates the text following it is a comment is the hash symbol (#). Comments in Python are used to provide explanations or annotations within the code, making it easier to understand without affecting the execution of the program. When Python encounters the hash symbol, it ignores everything on the line after it, allowing developers to include notes, disable code, or clarify complex logic without impacting the functionality of their scripts. The other symbols listed do not serve this purpose in Python. For instance, the semicolon (;) is used as a statement terminator in some other programming languages but is not necessary in Python and does not denote comments. The exclamation mark (!) is commonly used in other programming contexts or languages (such as in shell scripting) but is not a symbol for comments in Python. Lastly, the double dash (--) is often used in SQL for comments but is not valid for Python, further underscoring the importance of the hash symbol for marking comments in Python code specifically.