0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

1 つの実数を出力 4 Python3編

Posted at

次はこれ
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__format_real_number_step4

formatをつかえばいいとおもうけど 変数Mどうやって入れよう。。。と思って

Arr = input().split()
N = float(Arr[0])
M = str(Arr[1])

print("{:.} + M + {f}".format(N))

エラーになった。。。。
どう書けばいいんかわからず調べる。

こうだった。
二重かっこにすればよかったんだ。。。

print("{:.{}f}".format(N,M))
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?