Skip to content

Instantly share code, notes, and snippets.

@MohamedRajabMohammed
Created June 26, 2020 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MohamedRajabMohammed/cc0319d52b37373b19c5d31e467f1879 to your computer and use it in GitHub Desktop.
Save MohamedRajabMohammed/cc0319d52b37373b19c5d31e467f1879 to your computer and use it in GitHub Desktop.
Price conversion function
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