The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 305 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Random Cinema:
We want to create a movie theater that displays entirely random movies. To help with this we’re going to write a program to create these random movie titles based on a user given list of words.
To accomplish this:
Create a function that takes a list of words and creates a string by combining three random words from that list. (hint: the module random has a function in it called choice that selects a random element from a list)
Have your program ask for a list of words from the user, then a number of movies they’d like to generate.
Create the indicated number of movie titles by calling your function on the list of words the user gave you.
Display your results to the user.
Sample Output:
Your code when run should look similar to this with the text in blue generated by the program and the text in green entered by the user.
>>>
Please enter a list of words:Â ["Space", "Show", "Adventure", "Story", "Love", "Wild", "Life"]
Please enter a number of movies you'd like to generate:Â 3
Welcome to Randoplex! Currently playing movies are:
Adventure Life Space
Show Love Story
Wild Space Life
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly