×

Sign in with twitter.

You can follow the user and hashtags.

Share your tips on social media.

Post relative tips.

If you have relative tips, click [Add relative tips] to post.

Pythonは文字列がシーケンシャルなオブジェクト

@tanakahisateru@tanakahisateru 1566 viewer 45 embed viewer embed
配列とかタプルとか
r,g,b,a = ['R', 'G', 'B', 'A' ]
r,g,b,a = ('R', 'G', 'B', 'A')

と同じことが文字列でもできて
r,g,b,a = 'RGBA'

この特性を利用したサンプルコードがこんなの

https://gist.github.com/1777841
Add relative tips

Users who share this tip.

Comments