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?

Python 復習

Last updated at Posted at 2024-06-04

はじめに

先日、職業訓練校を修了した、bdrccです。
最近はPHPに注力していたこともあり、Pythonの基本構文がだんだん抜けていることに気がつきました。
そこで、改めて基本的な文法を、ここでアウトプットしておこうと思います。

文字列を1文字ずつ配列に

splitではなく、list

name = 'bdrcc'
name_split = list(name)
print(name_split)
# ['b', 'd', 'r', 'c', 'c'] が出力される

1文字ずつの配列を結合

join(~)
これは記憶がありました

name_split = ['b', 'd', 'r', 'c', 'c']
name_join = ''.join(name_split)
print(name_join)
# bdrcc が出力される
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?