subtract - $ sign and calculation in python -


i'm trying calculate value in $ sign, , subtract it. not sure how...sorry if basic question, thank much.

import urllib.request bs4 import beautifulsoup import time   urleth = "https://coinmarketcap.com/currencies/ethereum/" page = urllib.request.urlopen(urleth) content = page.read().decode('utf-8') soup = beautifulsoup(content, 'html.parser') valeth = soup.find("span", {"id": "quote_price"}).decode_contents(formatter="html") print("ethereum price ", valeth) print(valeth) 

above good

below, not sure. valeth shows $ sign, , sure how subtract $100 has dollar sign.

value = (valeth - $100.00) print(value) 

you have make $100.00 100.00 then, can everything. suppose,

var = '$100.00' var = float(var[1:]) value = (valeth - var) print(value) 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -