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.

【4】リストの要素同士の計算

Last updated at Posted at 2021-10-11

演習問題

リスト型の変数名を「numbers」とし,

1.numbersへ 250, 120, 800, 670, 210を順に代入し,print()を用いて出力しましょう.
2.要素0と要素3の和をnumbers_sum,差をnumbers_diff ,剰余をnumbers_remへ代入し,print()を用いて出力しましょう.
3.要素1の値を190へ書き換え,print()を用いて出力しましょう.
4.numbersの最後の要素へ480を追加し,print()を用いて出力しましょう.

これからの演習は,特に指示がない限り .py ファイルで提出してください!

【コマンドでの出力例】

[250, 120, 800, 670, 210]
670
800
250
[250, 190, 800, 670, 210, 480]

解き終わり次第,まなBOXにて提出しましょう.演習の提出状況で成績判断をします.

次の演習

演習問題一覧はこちら

#引用
Amazon: たった1日で基本が身に付く! Python超入門

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?