2020-01-01から1年間の記事一覧
実行結果 ソース # 不必要なデーターはスルーする ages = [28, 50,'ひみつ', 8, 20, 78, 25, 22, 10,'無回答', 33] samples = list() for data in ages: if not isinstance(data, int): continue if data < 20 or data >= 30: continue samples.append(data)…
実行結果 ソース # 該当年齢を出す ages = [28, 50, 8, 20, 78, 25, 22, 10, 27, 33] num = 5 samples = list() for data in ages: if 20 <= data < 30: samples.append(data) if len(samples) == num: break print(samples) print(' ∧ ∧ 感染爆発の重大局面…
実行結果 ソース # 平均点を求める count = 0 student_num = int(input('学生の数を入力してください>>')) score_list = list() while count < student_num: count += 1 score = int(input('{}人目の試験の得点を入力>>'.format(count))) score_list.append(…
実行結果 ソース is_awake = True count = 0 while is_awake == True: count += 1 print('ひつじが{}匹'.format(count)) key = input('もう眠りそうですか?(y/n)>>') if key == 'y': is_awake = False print('z...z...z....') print(' ∧ ∧ good job!')print…
実行結果 ソース count = 0 while count < 3: count += 1 print('ひつじが{}匹'.format(count)) print('z...z...z....') print(' ∧ ∧ good job!')print('( ゚Д゚)')print('海と猫が好き')
実行結果 ソース #トマトジュースも好きですよ name = input('あなたの名前を入力してください>>') print('{}さん、こんにちは'.format(name)) if name == 'モナー': print('モナーさんに会えて嬉しいです') food = input('{}さんの好きな食べ物を教えてくだ…
実行結果 ソース score = int(input('試験の点数を入力>>')) if score >= 60 and score <= 100: print('合格') else: print('不合格') print(' ∧ ∧ good job!')print('( ゚Д゚)')print('海と猫が好き')
実行結果 ソース # scoresに登録がない場合は科目と点数を登録する scores = {'network': 60,'database': 80, 'security': 50} key = input('追加する科目を入力してください>>') if key in scores: print('すでに登録済みです') else: data = int(input('得…
実行結果 ソース(ジュースを含む文字列はみな好き) #トマトジュースも好きですよ name = input('あなたの名前を入力してください>>') print('{}さん、こんにちは'.format(name)) food = input('{}さんの好きな食べ物を教えてください>>'.format(name)) if …
実行結果 ソース score = int(input('試験の点数を入力してください>>')) if score >= 60: print('合格') print('よくがんばりましたね') else: print('不合格') print('追試を受けてください') print(' ∧ ∧ you are genius')print('( ゚Д゚)')print('海と猫が…
実行結果 ソース #私も好きですよ name = input('あなたの名前を入力してください>>') print('{}さん、こんにちは'.format(name)) food = input('{}さんの好きな食べ物を教えてください>>'.format(name)) if food == 'カレー': print('素敵です。カレーは最…
実行結果 ソース #私も好きですよ name = input('あなたの名前を入力してください>>') print('{}さん、こんにちは'.format(name)) food = input('{}さんの好きな食べ物を教えてください>>'.format(name)) print('私も{}が好きですよ'.format(food)) print(' …
# 趣味の共通点 member_hobbies = { '松田' : {'apple','peach','lemon'}, '浅木' : {'orange','banana','peach'} } common_hobbies = member_hobbies['松田'] & member_hobbies['浅木'] print(common_hobbies) print(' ∧ ∧ New corona, pandemic')print('( …
# 点数管理 scores = [70,80,55] print(scores)print(scores[0]) print('要素数は{}'.format(len(scores)))print('合計は{}'.format(sum(scores))) print(' ∧ ∧ good job!')print('( ゚Д゚)')print('海と猫が好き')
# 点数管理 scores = [88,90,95] total = sum(scores) avg = total / 3 print('合計点は{},平均点は{}'.format(total,avg)) print(' ∧ ∧ good job!')print('( ゚Д゚)')print('海と猫が好き')
# 点数管理 network = 88database = 95security = 90 total = network + database + security avg = total / 3 print('合計点は{}'.format(total))print('平均点は{}'.format(avg)) print(' ∧ ∧ good job!')print('( ゚Д゚)')print('海と猫が好き')
# 割り勘計算 price = int(input('料金を入力>>'))number = int(input('人数を入力>>'))payment = int(price / number)print('お支払いは{}円です'.format(payment)) print(' ∧ ∧ good job!')print('( ゚Д゚)')print('海と猫が好き')
"""自己紹介プログラム作成者:小林モナー作成日:20200229 """# 円の直径と円周の求め方 print('半径が3cmの円の直径は')dia = 3 * 2print(dia) print('円の円周の長さは')print(dia * 3.14) print(' ∧ ∧ It is hard to come every day')print('( ゚Д゚)')…
"""自己紹介プログラム作成者:小林モナー作成日:20200229 """# コメント print(' ∧ ∧ It is hard to come every day') print('( ゚Д゚)')print('猫が好き')
#include <stdio.h>int main(void){int na,nb; puts("二つの整数を入力してください。");printf("整数A:"); scanf("%d", &na);printf("整数B:"); scanf("%d", &na); printf("AをBで割ると%dあまり%dです。\n", na/nb,na%nb); printf(" \n");printf(" ∧ ∧ It's hard to</stdio.h>…
#include <stdio.h>int main(void){ printf(" \n");printf(" ∧ ∧ Thank you again! \n");printf(" ( ゚Д゚) \n");return 0;}</stdio.h>