0

If I want to put

This is the 1 sentence, write a number: 5

This is the 2 sentence, write a number: 10

I don't want the input to appear on a different line.

This is the 1 sentence, write a number:

5

This is the 2 sentence, write a number:

10

The code I have is

number = 1 print("This is the", number, " sentence, write a number:") guess = input() number = number + 1 

it works but it writes the input on a different line. I've also tried doing it all under the input

number = 1 input("this is the", number, " sentence, write a number:") number = number + 1 

or even using the input(print('blahblah')) but that's returning None message?

1 Answer 1

1

You can do it like this:

guess = input("This is the " + str(number) + " sentence, write a number:") 
Sign up to request clarification or add additional context in comments.

1 Comment

This is tagged python 3, so you would write input instead of raw_input.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.