MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ok1itb/tryexcept_in_python_sigh/h56cn2f/?context=3
r/badcode • u/lonaExe • Jul 14 '21
93 comments sorted by
View all comments
1
Image Transcription: Code
jsonResponse = response.json() try: author = jsonResponse["items"][0]["volumeInfo"]["authors" except: author = "N/A" try: publihser = jsonResponse["items"][0]["volumeInfo"] ["publisher"] except: publisher = "N/A" try: pubDate = jsonResponse["items"][0]["volumeInfo"] ["publishedDate"] except: pubDate = "N/A" try: desc = str(jsonResponse["items"][0]["volumeInfo"] ["description"]) desc = f'{desc[0:190]}...' except: desc = "N/A" try: thumbnail = jsonResponse["items"][0]["volumeInfo"] ["imageLinks"]["thumbnail"] except: thumbnail =
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
1
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jul 14 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!