Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ok, so I'm writing the HTML for a web app that takes a list of movies and randomly selects one from the list. First part

image text in transcribed

Ok, so I'm writing the HTML for a web app that takes a list of movies and randomly selects one from the list.

First part of the page displays "Movie of the day" and then displays the name of the movie (which I have done correctly). Now the problem is to get the second part of the web app, directly underneath the first part, to display "Tomorrow's movie" and generate another random movie from the list. The code shown in the picture is what I initially thought what was correct. ALL OF THIS IS WRITTEN UNDER THE INDEX FUNCTION. USING PYTHON AS WELL!

I know it's incorrect, and i just need help to get the code correct. Thanks in advance.

1 from flask import Flask 2| import random app Flask(-name-) 6 app.configl'DEBUG'] True # displays runt ime errors in the browser, too 8 Gapp.route("") 10 def index(): # choose a movie by invoking our new function movie get_random_movie) 12 13 14 15 16 17 18 19 20 # build the response string content "1>Movie of the Day" content "ul>" content"
  • " +movie+"
  • " content"" return content movie

    Tomorrow's movie += "
      " movie +-"cli>" + movie movie "
    " Movie

    " 23 24 25 26 27 28 29 30 31 32 + " return movie get-random, movie(): movies ['The Thing','Prometheus', 'Childs Play', 'Moon', '28 Days Later'] random_movie random.choice(movies) return random_movie def

    Step by Step Solution

    There are 3 Steps involved in it

    Step: 1

    blur-text-image

    Get Instant Access to Expert-Tailored Solutions

    See step-by-step solutions with expert insights and AI powered tools for academic success

    Step: 2

    blur-text-image

    Step: 3

    blur-text-image

    Ace Your Homework with AI

    Get the answers you need in no time with our AI-driven, step-by-step assistance

    Get Started

    Recommended Textbook for

    Database Processing

    Authors: David J. Auer David M. Kroenke

    13th Edition

    ISBN: B01366W6DS, 978-0133058352

    More Books

    Students also viewed these Databases questions

    Question

    Appreciate why polyphony is important in organizations

    Answered: 1 week ago

    Question

    3. Contrast relational contexts in organizations

    Answered: 1 week ago

    Question

    2. Describe ways in which organizational culture is communicated

    Answered: 1 week ago

    Question

    1. Describe and compare approaches to managing an organization

    Answered: 1 week ago