#やったこと
#学び
- join関数
lst = ["a","b","c","d","e"]
hoge = " ".join(lst)
print(hoge)
#a b c d e
hoge = ",".join(lst)
print(hoge)
#a,b,c,d,e
#リストの要素がintなら
lst_2 = [1,2,3,4,5]
map_lst_2 = map(str, lst_2)
hoge = " ".join(map_lst_2)
print(hoge)
#1 2 3 4 5
Go to list of users who liked
More than 5 years have passed since last update.
#やったこと
#学び
lst = ["a","b","c","d","e"]
hoge = " ".join(lst)
print(hoge)
#a b c d e
hoge = ",".join(lst)
print(hoge)
#a,b,c,d,e
#リストの要素がintなら
lst_2 = [1,2,3,4,5]
map_lst_2 = map(str, lst_2)
hoge = " ".join(map_lst_2)
print(hoge)
#1 2 3 4 5
Register as a new user and use Qiita more conveniently
Go to list of users who liked