0
0

数値を半角スペース、0埋めで出力 Python3編

Last updated at Posted at 2023-11-19

今回はこれ(半スペ埋め3桁)
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__print_width_step1

fstringでこれも攻略

N = int(input())
print(f"{N:>3}")

次はこれ(0埋め3桁)
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__print_width_step2

N = int(input())
print(f"{N:>03}")

その後も問題を解いたが、残り3問は全部今までの復習・応用問題だったので
一発合格だった

0
0
0

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
0
0