Python Forum
Trying to prompt user for 2 inputs on one line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to prompt user for 2 inputs on one line
#1
I am trying to see if I can prompt the user for two inputs at once. The code below will prompt the user for the food first and then after that
is entered another prompt will appear asking the user to enter the number of calories.

food = input('Food:')

calories = int(input('Number of Calories:'))

Is there a way to use one prompt that asks for two inputs? I would like the prompt to appear as shown below so they can enter the food next to Food: and then tab over and enter the calories next to Number of Calories:

Food: Chicken Number of Calories: 700
Reply


Messages In This Thread
Trying to prompt user for 2 inputs on one line - by pythonprogrammer - Sep-15-2019, 02:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Multiple inputs on the same line (beginner) dementshuk 9 2,910 Sep-03-2021, 02:21 PM
Last Post: dementshuk
  Automatic user/password entry on prompt by bash script PBOX_XS4_2001 3 2,870 May-18-2021, 06:42 PM
Last Post: Skaperen
  How to write a response if a user inputs a string horuscope42 3 2,281 Apr-29-2020, 03:39 PM
Last Post: deanhystad
  Perminantly saving user inputs + being able to retrieve it ThatOneGuyNoOneKnowsCodes 1 1,994 Oct-23-2019, 11:28 PM
Last Post: DT2000
  user inputs in constructing a dictionary Exsul 3 3,757 Apr-10-2019, 12:25 PM
Last Post: ichabod801
  unit testing a method that asks two user inputs() in console gebel 0 2,181 Apr-03-2019, 07:59 PM
Last Post: gebel
  question regarding user Inputs cibb 10 7,414 Apr-04-2017, 03:34 AM
Last Post: alicarlos13
  code that takes inputs for user name amounts etc and then sends custom message shaumyabrata 5 5,385 Feb-12-2017, 11:37 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020