Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cost= "£56"
- currencySymbol = cost[0]
- print (currencySymbol, cost[1:])
- Â: £56
- import re
- cost= "£560,000"
- match = re.search(r'([D]+)([d,]+)', cost)
- output = (match.group(1), match.group(2).replace(',',''))
- print (output);
- output -->('£', '560000')
- cost= "£56"
- currencySymbol = cost[0]
- print (currencySymbol, cost[1:])
- #when using file use encoding
- with open('index.html', encoding="UTF-8") as productFile:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement