Last active
December 14, 2023 05:36
-
-
Save 0x48piraj/3b3f9f3423a305f9082cbaba1062075f to your computer and use it in GitHub Desktop.
Random scripts and procedures in a nice little package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def citup(lst): | |
""" | |
chunk-it-up: break a list into n-sized chunks | |
""" | |
return [lst[i:i+n] for i in range(0, len(lst), n)] | |
mixedlol = [["a", 500, datetime.datetime], ["b", 1000, datetime.datetime], ["C", 1500, datetime.datetime]] # list of lists | |
def hoelol(mixedlol): | |
""" | |
Edit heterogeneous list of lists selectively | |
""" | |
lst = [] | |
for idx, (name,price,date) in enumerate(mixedlol): | |
lst.append([name.lower(),price,date]) | |
return lst | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment