Jan-23-2018, 06:08 AM
Hello Gurus,
I need some help with this(Remember, ">>" indicates user input);
I want to be able to let the user input their monthly expenses as an example below.
Welcome to the family financial analyzer.
How much does the family spend on groceries per month?
>> 1200.50
How much does the family spend on dining out per month?
>> 500.00
Here are your family finances analyzed.
Your family spends $1,700.50 on food per month
When I try this in python this is what I have done;
(1)
print("How much does the family spend on groceries per month?")
groceries_monthly = eval(input("How much does the family spend on groceries per month?: "))
print("How much does the family spend on dining out per month?")
and I have tried this too;
(2)
print("How much does the family spend on groceries per month?")
print("How much does the family spend on dining out per month?")
however, in number (1) it prints the statement twice and I only want it to print once and then allow the user to enter the amount and print the next question. in (2) it prints the statement one after the other and it doesn't allow the user to input the amount until both statements finish running.
Once that is done then print what the family spends on food for the month.
Thanks in advance for your help.
aka2d7
I need some help with this(Remember, ">>" indicates user input);
I want to be able to let the user input their monthly expenses as an example below.
Welcome to the family financial analyzer.
How much does the family spend on groceries per month?
>> 1200.50
How much does the family spend on dining out per month?
>> 500.00
Here are your family finances analyzed.
Your family spends $1,700.50 on food per month
When I try this in python this is what I have done;
(1)
print("How much does the family spend on groceries per month?")
groceries_monthly = eval(input("How much does the family spend on groceries per month?: "))
print("How much does the family spend on dining out per month?")
and I have tried this too;
(2)
print("How much does the family spend on groceries per month?")
print("How much does the family spend on dining out per month?")
however, in number (1) it prints the statement twice and I only want it to print once and then allow the user to enter the amount and print the next question. in (2) it prints the statement one after the other and it doesn't allow the user to input the amount until both statements finish running.
Once that is done then print what the family spends on food for the month.
Thanks in advance for your help.
aka2d7