Created
June 26, 2020 22:42
-
-
Save MohamedRajabMohammed/cc0319d52b37373b19c5d31e467f1879 to your computer and use it in GitHub Desktop.
Price conversion function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_converted_price(price): | |
stripped_price = price.strip("₹ ,") | |
replaced_price = stripped_price.replace(",", "") | |
find_dot = replaced_price.find(".") | |
to_convert_price = replaced_price[0:find_dot] | |
converted_price = int(to_convert_price) | |
return converted_price |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment