Search code examples
stringoutputnewlineline-breaks

I need to print an input on the same line and not below (which is a new line). Can someone fix my code?


I need to have an output like this:

Enter player name: Mark

Mark, choose a column: 2

and this is my code:

player = raw_input("Enter player name: ")

print player, ", choose a column: "; column = int(input())

this is the output of my code:

Enter player name: Mark

Mark, choose a column:

2

Can someone help me fix my code? By the way, I'm using python 2.7.6


Solution

  • column = int(input(player+ ", choose a column: ")) I guess you can do it in this way