Exam4Training

What will happen when you attempt to run the following code?

What will happen when you attempt to run the following code?

print(Hello, World!)
A . The code will raise the SyntaxError exception.
B. The code will raise the TypeError exception.
C. The code will raise the ValueError exception.
D. The code will print Hello, World! to the console.
E. The code will raise the AttributeError exception.

Answer: A

Explanation:

Topics: print() SyntaxError

Try it yourself:

# print(Hello, World!)

# SyntaxError: invalid syntax

The exclamation mark makes it a syntax error.

Exit mobile version