Skip to content

Instantly share code, notes, and snippets.

@Adobe-Android
Last active April 17, 2024 21:47
Show Gist options
  • Save Adobe-Android/2307166cc0f3abdf73caa5570288625b to your computer and use it in GitHub Desktop.
Save Adobe-Android/2307166cc0f3abdf73caa5570288625b to your computer and use it in GitHub Desktop.
#!/bin/env python3
def main():
purchase_price = 100
current_price = 200
percentage_change = round(((current_price - purchase_price) / purchase_price) * 100, 2)
print(f"At ${current_price}, that is a change of {percentage_change}% from ${purchase_price}")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment