Advertisement
Guest User

Untitled

a guest
Feb 17th, 2021
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from urllib.request import* # importing all from urllib.request and using urlopen directly is shorter than importing urllib.request and getting urlopen with urllib.request.urlopen
  2. try:print(bool(urlopen(input()))) # no lambda necessary; just pass input straight to the function. also, input() is shorter than sys.argv[1] and importing sys, and int() is not neccessary, as booleans are allowed as output. finally, try statements can be in one line
  3. except:print(0) # except statements can be in one line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement