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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -