Home A small Python snippet
Post
Cancel

A small Python snippet

A small Python snippet

Caluclating percentage change

Desktop View

Just a quick little update, Uni has been asking alot of questions that require working out the percentage change between two numbers. Instead of constantly opening the calculator or excel I wrote this little code to make my life easier:

1
2
3
4
v1 = float(input("Enter V1: "))
v2 = float(input("Enter V2: "))
change = ((v2-v1)/v1*100)
print(change)
This post is licensed under CC BY 4.0 by the author.
Recently Updated
Trending Tags
Contents
Trending Tags