General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Lawrence D’Oliveiro
Indently
comments
Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "Backslash "" Has FAR More USES Than You THOUGHT In Python" video.
Here’s the way I do it: if params != None ∶ if ( isinstance(params, dict) and all(isinstance(k, str) and isinstance(v, (int, str)) for k, v in params․items()) ) ∶ paramsstr = "&"․join \ ( "%s=%s" % (k, quote_url(str(v))) for k, v in params․items() )
1
elif ( isinstance(params, tuple) and all(isinstance(i, tuple) and len(i) == 2 for i in params) and all(isinstance(k, str) and isinstance(v, (int, str)) for k, v in params) ) ∶ paramsstr = "&"․join("%s=%s" % (k, quote_url(str(v))) for k, v in params) else ∶ raise TypeError("params are not a dict or tuple of suitable (key, value) pairs") ♯end if else ∶ paramsstr = "" ♯end if
1