-3

I'm doing some coursework and I need to determine a character's name. This is what I have so far:

charOne=input("Please input your first character's name: ")
charTwo=input("Please input your second character's name: ")

So the user inputs the names, and now I need to ask the user to choose one of these characters.

chooseCharacter=input("What character do you want to use?"

I need to put the users charOne and charTwo into the question. Or some way need to make the user choose the user they want to use.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
  • 2
    I'm not sure what it is you're asking here, can you go into more detail and show more of your code? – SuperBiasedMan May 07 '15 at 16:07
  • Yea, at the beginning the program asks what you want your name to be- charOne=input("Please input your first character's name: ") charTwo=input("Please input your second character's name: ") So you write two names (e.g michael, and wade) now i need to ask the user to choose one of these characters chooseCharacter=input("What character do you want to use?" and i need to put the users charOne and charTwo into the question. or some way need to make the user choose the user they want to use. – Michael Wade May 07 '15 at 16:10
  • sorry, @SuperBiasedMan thats my code, since i have to write 15 chars, hi :) – Michael Wade May 07 '15 at 16:25
  • @MichaelWade Ok, then take a look at what Peter Wood linked above. There are two main ways to insert a variable into a string, that link shows them both and has discussion on them. – SuperBiasedMan May 07 '15 at 16:30

1 Answers1

4

Use Python string formatting:

charOne = input("Please input your first character's name: ")
charTwo = input("Please input your second character's name: ")

chooseCharacter = input("What character do you want to use? (%s or %s): " % (charOne, charTwo))
ospanoff
  • 106
  • 5