futurebird,
@futurebird@sauropods.win avatar

Did you know in python you can stick a for loop in the list brackets and just BAM have a list? No “append” check it:

l=[chr(i+65) for i in range(0,26)]
print(l)

> [‘A’, ‘B’, ‘C’, … , ‘Z’]

(it will be the letters A-Z since the unicode for the capital letter starts at 65, chr renders these numbers as letters.)

Is that classy? For some reason this neat little feature isn’t really taught. I guess with a loop and appending you have not flexibility— but still this is cool.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • provamag3
  • ethstaker
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • tacticalgear
  • anitta
  • megavids
  • Leos
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines