This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
def main(): | |
months_in_year = 12 | |
portion_of_year = 7.6 | |
print(months_in_year * portion_of_year) | |
if __name__ == "__main__": | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
# Formula Resources: | |
# https://www.omnicalculator.com/finance/compound-interest#example-2-complex-calculation-of-the-value-of-an-investment | |
def main(): | |
starting_balance = 5_000 | |
years_to_achieve = 1 | |
rate_of_return = 0.03 | |
compound_frequency = 12 # number of times compounded per year |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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__": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
def main(): | |
y = 13 | |
x = 52 | |
percentage = round((y / x) * 100) | |
print(f"{y} is {percentage}% of {x}") | |
if __name__ == "__main__": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
def main(): | |
num1 = 80 | |
num2 = 100 | |
absolute = abs(num1 - num2) | |
average = (num1 + num2) / 2 | |
answer = round((absolute / average) * 100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
def main(): | |
num1 = 29.89 | |
num2 = 29.86 | |
midpoint = (num1 + num2) / 2 | |
print(midpoint) | |
if __name__ == "__main__": | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
def main(): | |
dividend = 1500 | |
divisor = 52 | |
limit = 6500 | |
increment_num = 100 | |
while dividend <= limit: | |
# print(dividend) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Twitch chat browsersource CSS for OBS | |
Just set the URL as https://www.twitch.tv/%%TWITCHCHANNEL%%/chat?popout=true | |
And paste this entire file into the CSS box | |
Original by twitch.tv/starvingpoet modified by github.com/Bluscream and later github.com/Adobe-Android | |
General Settings | |
*/ | |
body { | |
color: #FFFFFF!important; |
NewerOlder