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?

More than 3 years have passed since last update.

string.join()を用いてリストから文字列や整数に変換する方法

Posted at

以下のような標準入力に対して、文字列や整数に変換する方法です。

1 3 2

実装

n = input().split()           # => ['1', '3', '2']
string_n = ''.join(n)         # => '132'
int_n = int(''.join(n))       # => 132

参考文献

  • 入門 Python3
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?