出力について(続き1)

Kazunori Kamiya
Aug 9, 2017 · 2 min read

・Exercise8:出力の続き

ここでは、文字列のフォーマットの作成方法について見ていきます。
細かいことは言わず、下のプログラムを作成して実行してみてください。

出力結果について

実行すると、以下のようになると思います。

ここでは、どのようにしてformatterの中にformatterを入れたのか注意して学習してください。
4つ目のputsの中でfirstからfourthまでそれぞれformatterを挿入していますが、こうすることでformatterを4回繰り返して出力しています。

学習ドリル

  1. それぞれの行の上に、それが何を意味するのかコメントを記入してください。

学習ドリルの答え

  1. 以下のようになります。

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade