Created
January 24, 2017 01:40
-
-
Save lasershow/b6cae8e0b40c564e75002f9ef4879a36 to your computer and use it in GitHub Desktop.
Python基礎 〜関数まで 超簡易ブログ機能
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create(blogs): | |
print('1:ブログを作成する') | |
blog = {} | |
print(blog) | |
blog["title"] = input() | |
blog["content"] = input() | |
print(blog) | |
blogs.append(blog) | |
blogs = [] | |
print(blogs) | |
while True: | |
print('以下より行う操作を選んでください') | |
print('1:ブログを作成する') | |
print('2:作成されたブログを見る') | |
print('3:ブログアプリを終了する') | |
number = int(input()) | |
if number == 1: | |
create(blogs) | |
elif number == 2: | |
print('2:作成されたブログを見る') | |
for blog in blogs: | |
print(blog["title"]) | |
print(blog["content"]) | |
elif number == 3: | |
print('3:ブログアプリを終了する') | |
break | |
else: | |
print('1から3を入力してください') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment