Skip to content

Instantly share code, notes, and snippets.

@nekoppy
nekoppy / if_tempurature.py
Last active August 1, 2019 04:45
if-elif-else tempurature
temp = 33
if 25<=temp:
print("夏日です。")
elif 30<=temp:
print("真夏日です。")
elif 35<=temp:
print("猛暑日です。")
else:
print("上着が必要かもしれません。")
@nekoppy
nekoppy / if_elif_else_input_Exercises
Created August 1, 2019 05:10
if-elif-else-input-Exercises
text = input('テストの点数は?')
point = int(text)
if point >= 80:
print('優')
elif point >= 70:
print('良')
elif point >= 60:
print('可')
else:
print('不可')
@nekoppy
nekoppy / if_input.py
Created August 1, 2019 05:37
if-input
point_input = input("あなたの点数は?")
point = int(point_input)
if point >= 80:
print("あなたの成績は優です。")
@nekoppy
nekoppy / format_input.py
Created August 1, 2019 05:39
format()-input
atesaki = "佐藤"
okurinusi = "山田"
kinngaku = 10000
text_template = '''{}様
株式会社NEKOPPYの{}です。
今月の請求金額は{}円です。
よろしくお願いいたします。'''
text=text_template.format(atesaki, okurinusi, kinngaku)
print(text)
season = ["春","夏","秋","冬"]
gusu = [2,4,6,8]
kisu = [1,3,5,7,9]
food = ["魚","鳥","肉","そば","うどん","ナス"]
for grill in food:
print("焼き",grill)
point = [70,80,90,100]
total = 0
for sum in point:
total = total+sum
print("合計点は{}です。".format(total))
score_list = [70,80,90,100]
total = 0
for score in score_list:
total = total+score
print("合計点は{}です。".format(total))
week = ["月","火","水","木","金","土","日"]
print(week[1])
week = ["月","火","水","木","金","土","日"]
print("木" in week)