Skip to content

Instantly share code, notes, and snippets.

@Cyril-Pop
Created January 17, 2022 13:36
Show Gist options
  • Save Cyril-Pop/bce953eff06f70e44a0af6d40a896d23 to your computer and use it in GitHub Desktop.
Save Cyril-Pop/bce953eff06f70e44a0af6d40a896d23 to your computer and use it in GitHub Desktop.
lena = 1200.0
lenb = 1000
lenc = 2000.5
lend = 4000
#
splitlen = 1200
#
for curvLen in [lena,lenb,lenc,lend]:
quot, remain = divmod(curvLen, splitlen)
t = [x for x in [splitlen] * int(quot) + [remain] if x != 0 ]
print(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment