-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added question about tracking income #9
base: main
Are you sure you want to change the base?
Conversation
|
||
Welcome to **Tracking Income**! Here is the problem statement: | ||
|
||
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"write a code" -> "write a program"
``` | ||
The first element in `Money` indicates the amount of money the company has at the start of the day. The rest of the elements in the list indicate the amount of money being earned or spent throughout the day. The company should spend 12 dollars, earn 5, spend 6, earn 18, spend 25, spend 30, then earn 20 before the end of the day. | ||
|
||
Therefor your function should return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
therefore is spelt wrong
|
||
Welcome to **Tracking Income**! Here is the problem statement: | ||
|
||
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. | |
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expenses is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. |
```python | ||
def Income(Money): | ||
return sum(Money for Money in Money) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solution could be rewritten to be a little more clearer
Money = [200, -12, 5, -6, 18, -25, -30, 20] | ||
``` | ||
The first element in `Money` indicates the amount of money the company has at the start of the day. The rest of the elements in the list indicate the amount of money being earned or spent throughout the day. The company should spend 12 dollars, earn 5, spend 6, earn 18, spend 25, spend 30, then earn 20 before the end of the day. | ||
|
||
Therefor your function should return | ||
```python | ||
170 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would store the starting amount as a separate variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check comments
|
||
Welcome to **Tracking Income**! Here is the problem statement: | ||
|
||
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make more of a story here. Like give a scenario where its like "You are the accountant of a big company are you are trying to track money in and money out to make sure the company is not overspending. Here is a balance sheet of the day. Figure out if the company is making money,
|
||
Welcome to **Tracking Income**! Here is the problem statement: | ||
|
||
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expensises is money going out. Your job is to write a code to calculate how much money the company has at the end of the day. | |
You are given a list of revenue and expenses incurred by your company. Revenue is money coming in, Expenses is money going out. Your job is to write code that calculates how much money the company has at the end of the day. |
No description provided.