<jupyter_start><jupyter_text><jupyter_code>#list of 007 movies where <NAME> features <NAME>
moviesSeanConnery = ["Dr. No (1962)",
"From Russia with Love (1963)",
"Goldfinger (1964)",
"Thunderball (1965)",
"You Only Live Twice (1967)",
"Diamonds Are Forever (1971)",    
"Never Say Never Again (1983)"]  

#list of 007 movies where <NAME> features <NAME>
moviesDavidNeven=["<NAME> (1967)"]    

#list of 007 movies where <NAME> features <NAME>
moviesGeorgeLazenby=["On Her Majesty's Secret Service (1969)"]  
          
#list of 007 movies where <NAME> features <NAME>   
moviesRogerMoore=[ "Live and Let Die (1973)",
"The Man with the Golden Gun (1974)",
"The Spy Who Loved Me (1977)",
"Moonraker (1979)",
"For Your Eyes Only (1981)",
"Octopussy (1983)",
"A View to a Kill (1985)"]

#list of 007 movies where <NAME> features <NAME>  
moviesTimothyDalton=[
"The Living Daylights (1987)",
"Licence to Kill (1989)"  
]

#list of 007 movies where <NAME> features <NAME>  
moviesPierceBrosnan=[
"GoldenEye (1995)",
"Tomorrow Never Dies (1997)",
"The World Is Not Enough (1999)",
"Die Another Day (2002)"
]

#list of 007 movies where <NAME> features <NAME> 
moviesDanielCraig=["<NAME> (2006)",
"Quantum of Solace (2008)",
"Skyfall (2012)",
"Spectre (2015)"]
#1) create a list of lists (movies007). The list will be composed by each list of movies featured by each actor.

movies007=[]
movies007.append(moviesSeanConnery)
movies007.append(moviesDavidNeven)
movies007.append(moviesGeorgeLazenby)
movies007.append(moviesRogerMoore)
movies007.append(moviesTimothyDalton)
movies007.append(moviesPierceBrosnan)
movies007.append(moviesDanielCraig)
movies007
#2) How many movies were played by the first actor to play <NAME>?

movies007[0]
#How many movies were played by the last actor to play <NAME>?

len(movies007[-1])
#How many actors played the role of <NAME>?

len(movies007)
#Create a new list with the number of movies played by each actor

newmovielist = []

for i in range(len(movies007)):
  newmovielist.append(len(movies007[i]))

newmovielist
#How many movies were played by the actor who appeared most often in movies?      
max(newmovielist)
#How many movies were played by the actor who appeared in fewer movies?

min(newmovielist)
#Create a new list (movies007a) with all the films.
movies007a = []
movies007a.extend(moviesSeanConnery)
movies007a.extend(moviesDavidNeven)
movies007a.extend(moviesGeorgeLazenby)
movies007a.extend(moviesRogerMoore)
movies007a.extend(moviesTimothyDalton)
movies007a.extend(moviesPierceBrosnan)
movies007a.extend(moviesDanielCraig)
movies007a

#Sort the elements of the list

movies007a.sort()
movies007a
#Reverse the order of the list. What will happen if this method is executed twice? Does this method sort the list if it is not sorted?

movies007a.reverse()
movies007a
#What is the index of the movie "Spectre (2015)" in the list of movies?
movies007a.index('Spectre (2015)')
#Add the movie "007 and the bad Guy of the climate change (2020)" in the 11th position

movies007a.insert(10,"007 and the bad Guy of the climate change (2020)")

#It was a mistake. Remove the movie "007 and the bad Guy of the climate change (2020)"
movies007a.remove("007 and the bad Guy of the climate change (2020)")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10702238577123582, 'fraction_numerical': 0.08126341613002147, 'mean_word_length': 5.616632860040568, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '95886', 'license': 'MIT', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1103, 'n_words': 400, 'path': 'lab03.ipynb', 'repo_name': 'reevutrprog/TRPROG', 'size': '3361'}