Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

View BartoszCki's full-sized avatar

Bartosz Cierocki BartoszCki

View GitHub Profile
@BartoszCki
BartoszCki /beautiful_idiomatic_python.md
Last activeMay 18, 2018 12:38— forked fromJeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Notes from Raymond Hettinger's talk at pycon US 2013video,slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

foriin [0,1,2,3,4,5]:
tab=[]
10.timesdo
tab <<rand(10)
end
putstab
suma=0
tab.each{|i|suma=suma+i}
putssuma

[8]ページ先頭

©2009-2025 Movatter.jp