-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Added algorithm for DC electric power formula #8155
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
Conversation
| @@ -0,0 +1,60 @@ | |||
| """ | |||
| Calculating Electric Power | |||
| Description : Electric power can be said to be the rate at which | |||
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.
The provided code calculates the electric power for DC circuits based on the given input parameters, which include the potential difference (voltage), current, and resistance.
You should change PR name as DC Electric Power formula.
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.
Thankyou for the feedback
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.
change the function name to dc_power
| >>> power(potential_difference=5.0, current=6.0) | ||
| 30.0 | ||
| >>> power(current=2.0, resistance=5.0) | ||
| 20.0 | ||
| >>> power(potential_difference=4.0, resistance=2.0) | ||
| 8.0 |
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.
| >>> power(potential_difference=5.0, current=6.0) | |
| 30.0 | |
| >>> power(current=2.0, resistance=5.0) | |
| 20.0 | |
| >>> power(potential_difference=4.0, resistance=2.0) | |
| 8.0 | |
| >>> dc_power(potential_difference=5.0, current=6.0) | |
| 30.0 | |
| >>> dc_power(current=2.0, resistance=5.0) | |
| 20.0 | |
| >>> dc_power(potential_difference=4.0, resistance=2.0) | |
| 8.0 |
| """ | ||
|
|
||
|
|
||
| def power(**values: float) -> float: |
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.
| def power(**values: float) -> float: | |
| def dc_power(**values: float) -> float: |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Thanks for your contribution, but we already have an implementation of the electric power formula in electronics/electric_power.py. However, that implementation doesn't support calculating resistance, so you're free to build upon that implementation and extend its functionality. |


Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.