📅  最后修改于: 2022-03-11 14:47:07.981000             🧑  作者: Mango
actors = [
{
'name': "Will Smith",
'movie': "Pursuit of Happiness"
},
{
'name': "Brad Pitt",
'movie': "Ocean's 11"
},
{
'name': "Tom Hanks",
'movie': "Terminal"
},
{
'name': "Leonardo DiCaprio",
'movie': "Titanic"
},
{
'name': "Robert Downey Jr",
'movie': "Iron Man"
},
]
actor_name = input('Enter the actor name to find a movie - ')
for i in range(len(actors)):
if actor_name.lower() in actors['name'].lower():
print('Actor Name: ', actors['name'])
print('Movie: ', actors['movie'])
break
else:
print('Please choose a valid actor')