Created
January 8, 2018 15:07
-
-
Save iannase/4fc7b7f01b65a5c063e81f8ce4ff563b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import sys | |
import math | |
from prettytable import PrettyTable | |
while True: | |
# user inputs | |
print() | |
litecoinPerDay = float(input("How much Litecoin was the L3+ earning per day in the beginning?: ")) | |
litecoinPrice = float(input("How much will Litecoin be worth at the end of the year?: ")) | |
print() | |
# variables | |
sum = 0 | |
monthlyPay = 200.0 / litecoinPrice | |
# initialize table | |
t = PrettyTable(['Day', 'Litecoin Daily Reward', 'Total Litecoin Reward', 'Total USD Reward']) | |
# calculate earnings | |
for i in range(731): | |
sum+=litecoinPerDay | |
# subtract monthly spending | |
if i % 30 == 0 and i != 0: | |
sum -= monthlyPay | |
usdReward = sum * litecoinPrice | |
t.add_row(["Day " + str(i),'Ł'+str(round(litecoinPerDay,8)),'Ł'+str(round(sum,8)),'$'+str(round(usdReward,2))]) | |
if i < 300: | |
litecoinPerDay -= 0.0001 | |
else: | |
litecoinPerDay -= 0.00001 | |
print(t) | |
print() | |
print() | |
choice = input("Again? (y/n): ") | |
if choice == "y": | |
continue | |
if choice == "n": | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment