Question: #2 and #3 Code (2): - Run this code cell. Do not delete this cell or alter it. countries (Peru, United States, South Korea, Barbados,China,
Code (2): - Run this code cell. Do not delete this cell or alter it. countries ("Peru", "United States", "South Korea", "Barbados","China", Chile", "Germany, Morocco "Thailand",apan", "Spain", "China", "South Korea", "Russia", "South Korea, South Korea "Mexico". "Oman, "Kenya", "Canada", "Canada", Germany, Bulgaria", "Mozambique", "Zambia","Peru", "Peru", "Chile", "Cuba", "Mexico","apan", -France","Russia, "India", Thailand", "Albania". "Oman "Algeria", "Angola", "Belize", "Bhutan", "Kenya", "Bolivia, Brazil, Chad", "Belgium", "Cameroon", "Fiji") Pye Use for loops and the list above to solve the following problems. Make sure to run the cell above before moving on (1) How long is the list? Store the length of the lit into variable countries length and print it. Plant Python has several built-in methods for listy) (2 pes) countries_length for 1 in countries: countries_length 1 print(countries_length) # YOUR CODE MERE 47 (): 2) Print each country on a new line using the countries list 2 pts) YOUR CODE WERE 3) That was pretty cool. Now sort the list in alphabetical order, store it into a new list named sorted countries and print each country on each line. (Hint Python has several built-in methods for lists) (2 pts) 11 sorted_countries YOU CODE MERE Nene
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
