on-internet
← Community

getting the cursor of the user input to be on the same line as the printed statement

Stack Overflow ·

I have a program which I would like the user to input the answer on the same line as the question which is printed. the code looks like this: question = 1 number1 = 2 number2 = 2 print(question , ") " , "What is" , number1 , "+" , number2 , "? ") user_ans = int(input("")) #The Answer the user inputs to the question asked print (user_ans) But the Output is: 1) What is (number1) + (number2) ? (the cursor goes here) However how do I get the output to be this: 1) What is (number1) + (number2) ? (the cursor goes here)

Comments

Sign in or sign up to comment and upvote.

No comments yet.