Skip to content

Instantly share code, notes, and snippets.

@oiojin831
Created July 20, 2021 23:56
Show Gist options
  • Save oiojin831/591b22ce0525735d772f45108bc99d60 to your computer and use it in GitHub Desktop.
Save oiojin831/591b22ce0525735d772f45108bc99d60 to your computer and use it in GitHub Desktop.
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