Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions example1/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ def get_year(movie_tag):

n_movies = len(titles)

while(True):
while True:
idx = random.randrange(0, n_movies)

print(f'{titles[idx]} {years[idx]}, Rating: {ratings[idx]:.1f}, Starring: {actors_list[idx]}')

# comment the next line out to test user input with docker run -t -i
break

user_input = input('Do you want another movie (y/[n])? ')
if user_input != 'y':
break
Comment on lines -32 to -42

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:



if __name__ == '__main__':
main()