Help us understand the problem. What is going on with this article?

MEMO20190909

電車止まってて動けないのでお勉強する

tmp1 = 'hogehoge'
tmp2 = 'hugahuga'

text_template = 'テスト{}あばば{}テスト'

text = text_template.format( tmp1, tmp2 )

print(text) # テストhogehogeあばばhugahugaテスト と出る

print('テスト{}あばば{}テスト'.format( tmp1, tmp2 )) # こレでもテストhogehogeあばばhugahugaテスト と出る

for

for i in list_or_tuple:
print(i)

print("for終わった")

リストかタプルでやる。インデントは半角4つが望ましい(PEP8さんのお約束)
range(10)とかrange(1, 100)とかよく使いそう

point_list = [11, 22, 33, 44, 55]
total = 0

for point in point_list:
total += point

number_of_subjects = len(point_list)
average = total / number_of_subjects
print('合計は{}。平均は{}。'.format(total, average))
こんな感じ

if

your_point = input('点数をカンマ区切りで入力して下さい: ')
point_list = your_point.split(',')
total = 0

for point in point_list:
total += int(point)

subject_number = len(point_list)

excellent = subject_number * 100 * 0.8
good = subject_number * 100 * 0.65

if total >= excellent:
evaluation = 'EXCELLENT'
elif total >= good:
evaluation = 'GOOD'
else:
evaluation = 'BAD'

average = total / subject_number

print('点数の合計は{}です。平均点は{}です。'.format(total, average))
print('点数の評価は{}です。'.format(evaluation))

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away