Skip to content

Instantly share code, notes, and snippets.

View ajitesh123's full-sized avatar

Ajitesh Abhishek ajitesh123

View GitHub Profile
>>> import hashlib
>>> def hash(mystring):
... hash_object=hashlib.md5(mystring.encode())
... print(hash_object.hexdigest())
...
>>>
>>> hash("Kellogg first block")
10a4826ea290595ef96e945b31054254
@ajitesh123
ajitesh123 / api.py
Created March 10, 2019 04:25
Simple API Call
import requests
def main():
res=requests.get("http://data.fixer.io/api/latest?access_key=XXXXXXXXXXXX")
if res.status_code!=200:
raise Exception("Error API request unsuccessful")
data=res.json()
num=data["base"]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.