Mar-19-2024, 05:10 AM
i have this silly code meant to fix a URL that is missing as many as 7 start characters:
i hope you got a good laugh out of that code above.
if url.startswith('//'): url = 'https:' + url if url.startswith('://'): url = 'https' + url if url.startswith('s://'): url = 'http' + url if url.startswith('ps://'): url = 'htt' + url if url.startswith('tps://'): url = 'ht' + url if url.startswith('ttps://'): url = 'h' + urlis there a nice clean and pythonic way to refactor this code into 3 lines or fewer?
i hope you got a good laugh out of that code above.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.