A small Python snippet
Caluclating percentage change
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)