Sep-15-2019, 02:50 PM
(This post was last modified: Sep-15-2019, 02:55 PM by pythonprogrammer.)
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
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