Klein Python scripts, übungen 30.12.23

import datetime
current_time = datetime.datetime.now()
print(current_time)
f = open("file_name", "r")
print(f.read())
i = 1
while i <= 10:
     print(i)
     i = i + 1

def calcCost(item):
     if(item == "sweets"):
          return 3.99
     elif (item == "oranges"):
          return 1.99
     else:
          return 0.99

spent = 10
spent = spent + calcCost("sweets")
print("You have spent:" + str(spent))

def bitcoinToUSD(bitcoin_amount, bitcoin_value_usd):
  usd_value = bitcoin_amount * bitcoin_value_usd
return usd_value
answer = bitcoinToUSD(1.2,40000)

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“)

websites = ["facebook.com", "google.com", "amazon.com"]
for site in websites:
     print(site)

wichtige links:

https://scapy.readthedocs.io/en/latest/introduction.html

https://docs.pwntools.com/en/stable/

https://tryhackme.com/room/pythonbasics

Kommentar verfassen

Quote of the week

“Imagination is more important than knowledge.  For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution.”

— Albert Einstein