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練習問題】リスト操作編

Posted at

下記記事の続きです

2.リスト操作

Q.2-1:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list[2:2] = [100,200]
print(list)

Q.2-2:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list[1:3] = [100,200]
print(list)

Q.2-3:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list.insert(2,100)
print(list)

Q.2-4:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list.append(100)
print(list)

Q.2-5:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list.pop()
print(list)

Q.2-6:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list.pop(4)
print(list)

Q.2-7:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list.remove(2)
print(list)

Q.2-8:次のコードを実行した結果を答えなさい

list = [0,1,2,3,4,5,6]
list.extend([100,200])
print(list)
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?