Ok so im making a rocks paper scissors game using python and I keep getting this error "TypeError: can only concatenate str (not "int") to str" and idk how to fix it. I have put the problem section of code and I hope someone else can see the error that I dont.while player == False:

#set player to True
23 print("Computer: " + computerscore + "\nPlayer: " + playerscore + "\n")
player = input("Rock, Paper, Scissors? ")
if player == computer:
print("Tie!")
elif player == "Rock":
if computer == "Paper":
print("You lose!", computer, "covers", player)
computerscore += 1
else:
print("You win!", player, "smashes", computer)
playerscore += 1
elif player == "Paper":
if computer == "Scissors":
print("You lose!", computer, "cut", player)
computerscore += 1
else:
print("You win!", player, "covers", computer)
playerscore += 1
elif player == "Scissors":
if computer == "Rock":
print("You lose...", computer, "smashes", player)
computerscore += 1
else:
print("You win!", player, "cut", computer)
playerscore = 1
else:
print("That's not a valid play. Check your spelling!")

The main problem is in line 23 thx

The problem is that you are trying to concatenate a string (the variable computerscore) with an integer (the variable playerscore). To fix this, you need to convert the integer to a string before you can concatenate them. You can do this by using the str() function.

while player == False:
#set player to True
23 print("Computer: " + computerscore + "\nPlayer: " + str(playerscore) + "\n")
player = input("Rock, Paper, Scissors? ")
if player == computer:
print("Tie!")
elif player == "Rock":
if computer == "Paper":
print("You lose!", computer, "covers", player)
computerscore += 1
else:
print("You win!", player, "smashes", computer)
playerscore += 1
elif player == "Paper":
if computer == "Scissors":
print("You lose!", computer, "cut", player)
computerscore += 1
else:
print("You win!", player, "covers", computer)
playerscore += 1
elif player == "Scissors":
if computer == "Rock":
print("You lose...", computer, "smashes", player)
computerscore += 1
else:
print("You win!", player, "cut", computer)
playerscore = 1
else:
print("That's not a valid play. Check your spelling!")

ok yeah but HOW do I do that?

The error you're encountering is due to trying to concatenate strings with integers in line 23. To fix this issue, you need to convert the integers `computerscore` and `playerscore` to strings before concatenating them with other strings. Here's the corrected line 23:

```python
print("Computer: " + str(computerscore) + "\nPlayer: " + str(playerscore) + "\n")
```

By adding `str()` around the variables `computerscore` and `playerscore`, you convert them into strings, allowing them to be concatenated with other strings without any errors.

The error you are facing is due to the fact that you are trying to concatenate a string with an integer in line 23 of your code. The error message "TypeError: can only concatenate str (not "int") to str" is indicating that you can only concatenate (join) two strings together, not a string and an integer.

To fix this error, you need to convert the integer variables `computerscore` and `playerscore` to strings before concatenating them with the other strings. You can use the `str()` function to convert the integer to a string.

Here's the corrected code for line 23:

```python
print("Computer: " + str(computerscore) + "\nPlayer: " + str(playerscore) + "\n")
```

By converting `computerscore` and `playerscore` to strings using `str()`, you can concatenate them with the other strings and eliminate the TypeError.

After making this change, the code should run without any errors, and you will be able to play your rock paper scissors game.