Skip to content

Instantly share code, notes, and snippets.

@Adobe-Android
Created May 13, 2024 22:46
Show Gist options
  • Save Adobe-Android/11a3b01a287436a10489330e234ed285 to your computer and use it in GitHub Desktop.
Save Adobe-Android/11a3b01a287436a10489330e234ed285 to your computer and use it in GitHub Desktop.
Calculate expected dividends for a given period
#!/bin/env python3
def main():
dividend_per_share = 0.2775
# Payout frequency within a year
# 4 for quarterly, 12 for monthly
# For 2 years, assuming quarterly payments, 8 would be an appropriate frequency
dividend_frequency = 4
share_count = 1
total_dividends = (dividend_per_share * share_count) * dividend_frequency
print(f"${total_dividends}")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment