LoginSignup
5
6

More than 5 years have passed since last update.

pythonで文字列ゼロ埋め、文字列からある文字をカウントする

Posted at

正規表現モジュールと合わせるとカスタム置換とかできる

ゼロ埋め

'1'.zfill(3)
#'001'

文字カウント

'hello world'.count('l')
#3
5
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6