Added question about tracking income#9
Open
eros-mcguire wants to merge 1 commit into
Open
Conversation
AJaccP
reviewed
Oct 21, 2023
|
|
||
| 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. |
djoga24
reviewed
Oct 21, 2023
l004p
reviewed
Oct 21, 2023
| ``` | ||
| 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 |
anshk8
reviewed
Oct 21, 2023
|
|
||
| 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. |
Collaborator
There was a problem hiding this comment.
Suggested change
| 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. |
yufengliu15
reviewed
Oct 21, 2023
| ```python | ||
| def Income(Money): | ||
| return sum(Money for Money in Money) | ||
|
|
Collaborator
There was a problem hiding this comment.
solution could be rewritten to be a little more clearer
AJaccP
reviewed
Oct 21, 2023
Comment on lines
+12
to
+19
| 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.
i would store the starting amount as a separate variable
djoga24
reviewed
Oct 21, 2023
|
|
||
| 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. |
Collaborator
There was a problem hiding this comment.
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. |
Collaborator
There was a problem hiding this comment.
Suggested change
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.