Battleship: Play It, Sam!


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

https://www.codecademy.com/courses/learn-python/lessons/battleship/exercises/play-it-sam
<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>
Can you please explain me the second line of code below. I simply don’t understand the syntax, this print statement is confusing. Processor first prints the word “Turn”, ok I get it, but then how is it possible that it works with comma and that then formula works. I assume that this is specific syntax for Python but would still like to hear an explanation if possible

```python

for turn in range(4):
print “Turn”, turn + 1

<do not remove the three backticks above>

#2

This is a simple form of string concatenation but instead of + we can use , which inserts a space character then prints the remaining expression value.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.