234k views
12 votes
Which code will allow Jean to print Coding rocks! on the screen?

print("Coding rocks!")
print(Coding rocks!)
print = (Coding rocks!)
print = Coding rocks.

2 Answers

13 votes

Answer:

print("Coding rocks!")

Step-by-step explanation:

As you can see, the other options either have wrong syntax, or will not run.

Therefore the first one will be the correct answer.

User JayJay
by
4.3k points
9 votes

Answer:

The correct answer is:

Option 1: print("Coding rocks!")

Step-by-step explanation:

Coding Rocks! is a string and when the string has to be printed directly using print function it is written in quotation marks.

In the given options,

The first option is correct as the syntax of print is correct and the string is written in quotation marks.

In the other options, either the syntax is not correct or the quotation marks are missing.

Hence,

The correct answer is:

Option 1: print("Coding rocks!")

User Robin Wieruch
by
5.4k points