Problem printing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Problem printing

so, im kinda new to python, im sorry if this question sounds silly if Player == CPU: print("Computer: " + str((CPU))) print("Player: " + str((Player)) print("Draw!") elif Player == "rock": if CPU =="paper": print("Computer: " + str((CPU)) print("Player: " + str(User)) print("Computer wins!") else print("Computer: " + str((CPU)) print("Player: " + str(User)) print("Player wins!") this is part ofthe code of the little game im doing of rock, paper, scissors but when i compile, it gives me syntax error, with the second print command i think the problem it's something like i can't do a second printing command, but i don't find this making much sense, i don't think either that i have to put "\n" everytime can be the solution, because i think i see other codes using the print command multiple times afther a if command what im supposed to do?

31st Jan 2017, 1:11 PM
Shaoke
Shaoke - avatar
3 Answers
+ 6
maybe it's the "+" ? try a comma maybe I'm wrong though
31st Jan 2017, 1:48 PM
Ahri Fox
Ahri Fox - avatar
+ 3
Why do you use double parenthesis on str() function with 'CPU' and 'Player' variables? Do it as you do with 'User' variable ;P
31st Jan 2017, 1:30 PM
visph
visph - avatar
+ 1
thanks a lot for the help, the problem was because the double parenthesis
31st Jan 2017, 2:00 PM
Shaoke
Shaoke - avatar