-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitcoin Project.py
More file actions
27 lines (20 loc) · 803 Bytes
/
Bitcoin Project.py
File metadata and controls
27 lines (20 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
In this project, you'll create a program that tells
you when the value of your Bitcoin falls below $30,000.
You will need to:
- Create a function to convert Bitcoin to USD
- If your Bitcoin falls below $30,000, print a message.
You can assume that 1 Bitcoin is worth $40,000
"""
investment_in_bitcoin = 1.2
bitcoin_to_usd = 40000
# 1) write a function to calculate bitcoin to usd
def bitcoinToUSD(bitcoin_amount, bitcoin_value_usd):
return bitcoin_amount * bitcoin_value_usd
# 2) use function to calculate if the investment is below $30,000
investment_in_usd = bitcoinToUSD(investment_in_bitcoin, bitcoin_to_usd)
if investment_in_usd <= 30000:
print("Investment below $30,000! SELL!")
else:
print("Investment above $30,000")
# The flag is: THM{BITC0IN_INVESTOR}