Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions maths/percentage_calculator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def calculate_percentage(value, percent):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is no test file in this pull request nor any test function or class in the file maths/percentage_calculator.py, please provide doctest for the function calculate_percentage

Please provide return type hint for the function: calculate_percentage. If the function does not return a value, please provide the type hint as: def function() -> None:

Please provide type hint for the parameter: value

Please provide type hint for the parameter: percent

return (value * percent) / 100


value = float(input("Enter value: "))
percent = float(input("Enter percentage: "))

result = calculate_percentage(value, percent)

print("Result:", result)
Loading