Created
July 20, 2021 23:56
-
-
Save oiojin831/591b22ce0525735d772f45108bc99d60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import random | |
movies = [] | |
while True: | |
print("1. 영화 추가") | |
print("2. 영화 보기") | |
print("3. 랜덤 영화 고르기") | |
print("4. 종료") | |
number = int(input("번호?")) | |
if number == 1: | |
title = input("제목?") | |
rating = input("평점?") | |
new_movie = {} | |
new_movie["title"] = title | |
new_movie["rating"] = rating | |
movies.append(new_movie) | |
elif number == 2: | |
for movie in movies: | |
print('title', movie["title"]) | |
print('rating', movie["rating"]) | |
elif number == 3: | |
print(random.choice(movies)) | |
elif number == 4: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment